Question: Your task is to implement the loop portion of the code. THIS IS MSP430 CODE The answer should be less than 10 lines as stated

 Your task is to implement the loop portion of the code.

Your task is to implement the loop portion of the code. THIS IS MSP430 CODE The answer should be less than 10 lines as stated in the assignment. You are to create a loop to compare the number before it and copy it to List_Out and skip the copy it is the same number.

urse Write an MSP430 assembly language subroutine. REP_FREE to examine the elements of a list of positive word-size numbers stored at location LIST_IN. The list is already sorted in an ascending order. The first element is the number, n. which is the length of the array. The subroutine will copy the elements from location LIST_IN to location LIST_OUT. While copying, if an element appears more than once (repeated), then the repeated copies are ignored. In essence, the subroutine eliminates the replicated elements from LIST_IN and places the results in LIST_OUT. Note that you need to update number m (the first element on the top) which is the actual number of elements in LIST OUT after eliminating all replicates. set the pointers REPFR mov.W #LIST IN, R4 mov.w #LIST_OUT, R5 iset pointer to LIST_IN array set pointer to LIST OUT array save R6 as a pointer where m need to be stored mov.w R5 R6 clrw R10 counter for the updated m number get the n number an exit if the array is empty mov.w @R4+. R11 save n number in R11 as a loop counter jZ done exit if LIST IN is empty incd.w R5 ;manually increment the pointer to LIST_OUT array copy the first element to LIST OUT, and exit if that is the only element mov.w @R4+, O(R5) ;copy first element from LIST_IN to LIST_OUT incd R5 manually increment pointer R5 inc R10 increment the m counter to count for first element move R11 decrement the n counter to count for first element move dec jz done create a loop to compare the next element to the one before it, and if different copy it to the LIST_OUT, but if it is the same skip copying, then check the loop counter and loop again. loop ;enter your code here, less than 10 lines done mov.w R10, O(R6) save the m value at the top of the LIST OUT array ret

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!