Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help to complete this program. It's microprocessing systems assembly code. Instructions are given in the code above. 1 2 3 :MSP430 Assembler Code

image text in transcribed

image text in transcribed

I need help to complete this program. It's microprocessing systems assembly code. Instructions are given in the code above.

1 2 3 :MSP430 Assembler Code Template for use with TI Code Composer Studio 5 6 .cdecls C,LIST, "msp430.h" Include device header file 8 9 10 : Assemble into program memory :Override ELF conditional linking ; and retain current section : Additionally retain any sections : that have references to current ; section .text .retain 12 13 14 15 .retainrefs # STACK END , SP #WDTPwlWDTHOLD, &WDTCTL : Initialize stackpointer ; Stop watchdog timer RESET mov.w 17 18 19 20 21 StopWDT mov.w your lab3 code is here between double dashed lines :below is the 23 Lab3 mov.w #5, R4 clrw R5 clr.wR6 clr.w R7 clr.w R8 set up the initial a value in R4 25 2 6 27 29 30 31 32 Xcalc mov.wR4, RS call copy the a value into R5 :computer the absolute value of a in R5 #ABSOL Summation mov.wR5, R6 HEACTO istarting the upper limit with value a of the summation in R6 :get the factorial value of R6 and save in R6 call finish Xcalcby doubling the value and adding it to accumulator R8, ; repeat the loop with a-1, a-2 (in R5) till lower value a=0 ; save the Xcalc results in R5 35 36 37 38 39 40 41 42 43 mov.W R5, R7 :finish Fcalc by adding the constant 50 and dividing by 4 (hint shift twice to the right with carry-0) Fcalc :start F calculation loop jmp loop loop in place 45 4 6 47 48 49 50 51 52 53 54 Absolute subroutine take a value form R5 and converts it to its absolute value ABSOL: R5 twoscompl tst ret inv inc ret twoscompl R5 ABSOLend 1 2 3 :MSP430 Assembler Code Template for use with TI Code Composer Studio 5 6 .cdecls C,LIST, "msp430.h" Include device header file 8 9 10 : Assemble into program memory :Override ELF conditional linking ; and retain current section : Additionally retain any sections : that have references to current ; section .text .retain 12 13 14 15 .retainrefs # STACK END , SP #WDTPwlWDTHOLD, &WDTCTL : Initialize stackpointer ; Stop watchdog timer RESET mov.w 17 18 19 20 21 StopWDT mov.w your lab3 code is here between double dashed lines :below is the 23 Lab3 mov.w #5, R4 clrw R5 clr.wR6 clr.w R7 clr.w R8 set up the initial a value in R4 25 2 6 27 29 30 31 32 Xcalc mov.wR4, RS call copy the a value into R5 :computer the absolute value of a in R5 #ABSOL Summation mov.wR5, R6 HEACTO istarting the upper limit with value a of the summation in R6 :get the factorial value of R6 and save in R6 call finish Xcalcby doubling the value and adding it to accumulator R8, ; repeat the loop with a-1, a-2 (in R5) till lower value a=0 ; save the Xcalc results in R5 35 36 37 38 39 40 41 42 43 mov.W R5, R7 :finish Fcalc by adding the constant 50 and dividing by 4 (hint shift twice to the right with carry-0) Fcalc :start F calculation loop jmp loop loop in place 45 4 6 47 48 49 50 51 52 53 54 Absolute subroutine take a value form R5 and converts it to its absolute value ABSOL: R5 twoscompl tst ret inv inc ret twoscompl R5 ABSOLend

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions