Answered step by step
Verified Expert Solution
Question
1 Approved Answer
4. (25 points) Design and write an MSP430 assembly language subroutine that returns the maximum absolute value of a signed integer array, i.e., MAXABS-maximum(Ia(i)I), i0,
4. (25 points) Design and write an MSP430 assembly language subroutine that returns the maximum absolute value of a signed integer array, i.e., MAXABS-maximum(Ia(i)I), i0, n-1, n>0. 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? RESET StopWDT mov .w # STACK END,SP mov .w #NDTPWIWDTHOLD,&MDTCTL ; stop watchdog timer Initialize stackpointer main: bis . b bis . b push mov.w sub.w rra.W push call add .w mov.b Swpb mov.b Jmp #0xFF,8P1DIR #0xFF,8P2DIR #arri #aend, R5 #arri, R5 R5 R5 #maxabs #4, SP R12, P1OUT R12 R12, P2OUT 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 arr1: aend: .int 1, 2, 3, 4, -5, -9, -12, 11 ; signed array maxabs: write your code here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started