Question
Answered step-by-step

please write fill in the missing the loop code. Write an MSP430...

please write fill in the missing the loop code. 

 

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            ;set pointer to LIST_IN array
                    mov.w    #LIST_OUT, R5       ;set pointer to LIST_OUT array
                    mov.w    R5, R6                          ;save R6 as a pointer where m need to be stored
                    clr.w       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+, 0(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
                   dec          R11                                ;decrement the n counter to count for first element move 
                   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, 0(R6)               ;save the m value at the top of the LIST_OUT array
                    ret
 

Answer & Explanation
Verified Solved by verified expert
<p>entesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar to</p> Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet

Unlock full access to Course Hero

Explore over 16 million step-by-step answers from our library

Subscribe to view answer

facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, d
oo
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapi
at, ultrices ac magna. Fuscecing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus effic
gue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinitesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel lao
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusc
m risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Doac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilis
o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pelgue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar torto

cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficrisus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel lao
usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lo

cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficusce dui lectus
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficm ipsum dolor sit amet, consectetur adipiscing
cing elit. Nam lacinia pulvinar tortor nec faamet, consectetur adipiscing elit. Nam lacinia pulvi
at, ultrices ac magna. Fusce dui lectus, cons a molestie consequat, ultrices ac magna. Fusc
amet, consectetur adipiscing elit. Nam lacinia pulviat, ultrices ac magna. Fusce dui lectus, congu
a. Fusce dui lectus, congue vel laoreet ac, diamet, consectetur adipiscing elit. Nam lacinia pulvi
a. Fusce dui lectus, congue vel laoreet ac, diultrices ac magna. Fusce dui lectus, congue v
amet, consectetur adipiscing elit. Nam lacinia pulviac, dictum vitae odio. Donec aliquet. Lorem ip
rem ipsum dolor sit amet, consectetur adipisciamet, consectetur adipiscing elit. Nam lacinia pulvi
congue vel laoreet ac, dictum vitae odio. Dom ipsum dolor sit amet, consectetur adipiscing e
amet, consectetur adipiscing elit. Nam lacinia pulvifficitur laoreet. Nam risus ante, dapibus a m
ec aliquet. Lorem ipsum dolor sit amet, consecteamet, consectetur adipiscing elit. Nam lacinia pulvi

et, consectetur ad
ec facilisis. Peet, consectetur adipiscing elit. Nam lacinia pul
onec aliquet. Logue vel laoreet a
et, consectetur adipiscing elit. Nam lacinia pul, consectetur a
itur laoreet. Namet, consectetur adipiscing elit. Nam lacinia pul
a. Fusce dui lecFusce dui lectu
et, consectetur adipiscing elit. Nam lacinia pulitur laoreet. Nam
amet, consectetuet, consectetur adipiscing elit. Nam lacinia pul
, ultrices ac magniscing elit. Nam
et, consectetur adipiscing elit. Nam lacinia pulDonec aliquet. Lorem

s a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictfacilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat,
lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet.m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque da
ipsum dolor sit amet, consectetur adipisciec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing
icitur laoreet. Namat, ultrices ac magna. Fusce dui lectus,
facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibulestie consequat, ultrices ac magna. Fusce dui lectus, congue vel
gue vel laoreet ac, dictum vitae odio. Doitur laoreet. Nam risus ante, dapibus
gue vel laoreetctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, co
ultrices ac

entesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapib
a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Loria pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultr
inia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequats a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec a
ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fuscea. Fusce dui lectus, congue vel laoreet ac, dictum
Fusce dui lectus, congue vel laoreet ac, dictum vitce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, conse
iscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risusfacilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui
ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risusnec facilisis. Pell
m ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tofacilisis. Pellentesque dapibus efficitur laoreet.
ec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam laciniaipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis
usce dui lectus, congue vel laoreet acconsectetur adipiscing elit. Nam lacinia pulvinar tortor
ng elit. Nam lacinia pulvinar tortor nec faciacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lao
Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipDonec aliquet. Lorem ipsum dolor sit amet, consectetur
Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Dsum dolor sit amet, consectetur adipiscing elit. Nam
congue vel laoreet ac, dictum vitaeFusce dui lectus, congue vel laoreet ac, dictum vitae odio. D
ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesqec aliquet.
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficgue vel laoreet ac, dictum
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus effice vel laoreet ac, dictum vitae odio. Donec a
ac, dictum vitae odio. Donec aliquet. Loreat, ultrices ac magna. Fusce
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficnec facilisis. Pe
cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficamet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus effic
iscing elit. Nam lacinia pulvinar tortor

Step-by-step explanation

lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet

a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur la