Question: 4. (25 points) Design and write an MSP430 assembly language subroutine that returns the minimum absolute value of a signed integer array, i e, MNBs-minimumaa@

 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 minimum absolute value of a signed integer array, i e, MNBs-minimumaa@ ), 0 n-1, n>0. The main program that calls the subroutine is shown below. What does input parameters? the main program do with the returned value? How do we pass the "msp430.h" NAME main PUBLIC main include #define controlled include file nodule nane make the ain label visible ; outside this odule EXTERN minabs ORG DC16 RSEG RSEG OFFFEh init CSTACK CODE i set reset vector to init' label i pre-declaration of segment i place progr in CODE segment SFE (CSTACK), Sp set up stack BIS.B #0xFF &PIDIR BIS.B #0xFF &P2DIR PUSH ; configure P1.x as output ; configure P2.x as output ; push the address of arr1 , , the next address arxl, R5 R5 R5 ; (#aend- #arr1) /2 is the number f elements ; push the numbe of elements on the stack :collapse the stack RRA. PUSH CALL #minabs ADD MOV.B R12,P1OUT SWPB MOV.B R12,P2OUT JMP #4,SP : display lower byte on P10UT R12 : display higher byte on P20UT arrl send DC16 1, 2, 3, 4,-5, -9, -12, 11 ; signed rray END PUBLIC sinabs RSEG CODE minabswrite 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!