Question: intro to microprocessor PLEASE help me! CDA3331C Intro to Microcomputers Lab Assignment Name: Grade: 120 [202) The program of this exercise deals with arrays of

intro to microprocessor
PLEASE help me!
 intro to microprocessor PLEASE help me! CDA3331C Intro to Microcomputers Lab
Assignment Name: Grade: 120 [202) The program of this exercise deals with

CDA3331C Intro to Microcomputers Lab Assignment Name: Grade: 120 [202) The program of this exercise deals with arrays of numbers and subroutines. Next page is the program outlines. At the beginning of your program you will allocate empty storage for two original arrays and their sorted versions. For the overall program layout, use the program skeleton file (lab2-472-A-skl) available on Canvas. [16] 2.a) Complete this MSP430 assembly language program where the SORTI section sets the R4/RS/R6 parameters, which are used by the COPY and SORT subroutines to copy and sort array ARYL. R4 holds the starting address of the array. RS holds the length of the array. R6 holds the starting location of the sorted array. COPY subroutine copies the contents of array ARYI into ARYIS. SORT subroutine sorts the elements on ARYIS in place. SORT2 section is similar to SORTI above using same registers. Arrays are in decimal notation! Sort Arrays in ascending order from lowest to highest value. Main Program: [6] for Program setup, and [10] for Sort Subroutine. Use the following values for the array elements. If the values in the skeleton code are different use these values. ARY1: (10, 34, -18, 87, -65, 28, -15,-49, 61, -77,45), ARY2: (10, 90, 46, 16, -55, -39, 32, 38, 12, 54, 23) 141 2.b) Run your program and verify the results by using the Memory Browser window in the CCS Debug view. Write the Hex Values in order: ARYIS: ARY2S: CDA3331C Intro to Microcomputers Lab Assignment Name: Grade: /20 Your Sorting lab starts here ;Memory allocation of Arrays must be done before the RESET and StopWoT ARY1 set exeee Memory allocation ARYA ARVAS xeze Memory allocation ARYS ARV2 .set exe22e Memory allocation ARY 25 exe23e Memory allocation AR 25 ARY clr clearing all register being use is a good programming practice clr cir 86 SORTI mov. mov.W call call call HARY, R4 initialize R4 as a pointer to array HARYS, R6 initialize R4 as a pointer to arrayt sorted ArraySetupl:then call subroutine ArraySetup *COPY Copy elements from ARYI TO ARYUS space SORT Sort elements in ARAYI SORT2 mov.W mov.W call call call ARY2, R4 initialize R4 as a pointer to array2 ARY2S, R6 initialize R4 as a pointer to array2 sorted ArraySetup2, then call subroutine ArraySetup2 COPY Copy elements from ARY2 to ARY2S space #SORT Sort elements in ARAY2 Mainloop jep Mainloop Infinite Loop ArraySetupl mov.b wie, #_ mov.b (R4) 1(R4) 2(R4) ; Array element initialization Subroutine First start with the number of elements and then fill in the 1e elements. mov.b ret ArraySetup2 ..... Similar to ArraySetupl subroutine COPY Copy original Array to allocated Array- Sorted space SORT ; Subroutine SORT sorts array from :lowest to highest value Your Sorting lab ends here - CDA3331C Intro to Microcomputers Lab Assignment Name: Grade: 120 [202) The program of this exercise deals with arrays of numbers and subroutines. Next page is the program outlines. At the beginning of your program you will allocate empty storage for two original arrays and their sorted versions. For the overall program layout, use the program skeleton file (lab2-472-A-skl) available on Canvas. [16] 2.a) Complete this MSP430 assembly language program where the SORTI section sets the R4/RS/R6 parameters, which are used by the COPY and SORT subroutines to copy and sort array ARYL. R4 holds the starting address of the array. RS holds the length of the array. R6 holds the starting location of the sorted array. COPY subroutine copies the contents of array ARYI into ARYIS. SORT subroutine sorts the elements on ARYIS in place. SORT2 section is similar to SORTI above using same registers. Arrays are in decimal notation! Sort Arrays in ascending order from lowest to highest value. Main Program: [6] for Program setup, and [10] for Sort Subroutine. Use the following values for the array elements. If the values in the skeleton code are different use these values. ARY1: (10, 34, -18, 87, -65, 28, -15,-49, 61, -77,45), ARY2: (10, 90, 46, 16, -55, -39, 32, 38, 12, 54, 23) 141 2.b) Run your program and verify the results by using the Memory Browser window in the CCS Debug view. Write the Hex Values in order: ARYIS: ARY2S: CDA3331C Intro to Microcomputers Lab Assignment Name: Grade: /20 Your Sorting lab starts here ;Memory allocation of Arrays must be done before the RESET and StopWoT ARY1 set exeee Memory allocation ARYA ARVAS xeze Memory allocation ARYS ARV2 .set exe22e Memory allocation ARY 25 exe23e Memory allocation AR 25 ARY clr clearing all register being use is a good programming practice clr cir 86 SORTI mov. mov.W call call call HARY, R4 initialize R4 as a pointer to array HARYS, R6 initialize R4 as a pointer to arrayt sorted ArraySetupl:then call subroutine ArraySetup *COPY Copy elements from ARYI TO ARYUS space SORT Sort elements in ARAYI SORT2 mov.W mov.W call call call ARY2, R4 initialize R4 as a pointer to array2 ARY2S, R6 initialize R4 as a pointer to array2 sorted ArraySetup2, then call subroutine ArraySetup2 COPY Copy elements from ARY2 to ARY2S space #SORT Sort elements in ARAY2 Mainloop jep Mainloop Infinite Loop ArraySetupl mov.b wie, #_ mov.b (R4) 1(R4) 2(R4) ; Array element initialization Subroutine First start with the number of elements and then fill in the 1e elements. mov.b ret ArraySetup2 ..... Similar to ArraySetupl subroutine COPY Copy original Array to allocated Array- Sorted space SORT ; Subroutine SORT sorts array from :lowest to highest value Your Sorting lab ends here

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!