Question: 4. (25 points) Design and write an MSP430 assembly language subroutine that returns the maximum absolute value of a signed integer array, ie, MAXAasamaximumla(i)I), i-o,

 4. (25 points) Design and write an MSP430 assembly language subroutine

4. (25 points) Design and write an MSP430 assembly language subroutine that returns the maximum absolute value of a signed integer array, ie, MAXAasamaximumla(i)I), i-o, n-1, nX). The main program that calls the subroutine is shown below. What does the main program do with the returned value? How do we pass the input parameters? #-STACK-END, SP DTPH MDTHOLD,&NDTCTLStop watchdog Initialize stackpointer RESET mov.w StopHoT mov eain: tiner bis-b #exFF,8P2DIR push #arri mov.w #aend, R5 sub.w #arr1,RS rra.w RS push RS call #maxabs configure P1.x as output ;configure P2.x as output ; push the address of arri ; the next address ; (#aend #arr1)/2 is the number of elements ; push the number of elements on the stack add .w #4, SP mov.b R12, P1OUT supb R12 mov.b R12, P2OUT arri: .int 1, 2, 3, 4, -5, -9, -12, 11 signed array aend: maxabs:write your code 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!