Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help finishing this code for my Microprocessors course 201 3) Implement the following arithmetic function using subroutines and develop the code to be

I need help finishing this code for my Microprocessors course
image text in transcribed
201 3) Implement the following arithmetic function using subroutines and develop the code to be as efficient as possible. The onl y input to the function is variable (a) that is initialized in register R4 at the beginning of the program to 5 and maintained thereafter. The X calculation result is stored in R5. The final answer, F, is stored in R7. our) X+50 1121 3.a) Write an MSP430 assembly language program that implements the above function using subroutines for Multiplication and Factorial. Multinhy subroutine should take into account sign values. The overall program structure should be as follows: RESET #-STACK-END,SP ;Initialize stack pointer nov .w LAB2 mov.w #5, R4 ; Load-a- into R4 CLEAR clr RS cir R6 clr R7 iclear the entire register clear the entire register iclear the entire register XCALC ithe x calculation part of your program itaking value of R4 as an input and returning result X in R5 FCALC... ithe final part of your program itaking inputs from R5 iand returning result Fin R7 MainLoop jmp Mainloop Infinite Loop MULT iIncluded in the skeleton code [2] for Main Program-[1] XCALC, [1] FCALC [5] for Factorial Subroutine 5] for Multiplication Subroutine 201 3) Implement the following arithmetic function using subroutines and develop the code to be as efficient as possible. The onl y input to the function is variable (a) that is initialized in register R4 at the beginning of the program to 5 and maintained thereafter. The X calculation result is stored in R5. The final answer, F, is stored in R7. our) X+50 1121 3.a) Write an MSP430 assembly language program that implements the above function using subroutines for Multiplication and Factorial. Multinhy subroutine should take into account sign values. The overall program structure should be as follows: RESET #-STACK-END,SP ;Initialize stack pointer nov .w LAB2 mov.w #5, R4 ; Load-a- into R4 CLEAR clr RS cir R6 clr R7 iclear the entire register clear the entire register iclear the entire register XCALC ithe x calculation part of your program itaking value of R4 as an input and returning result X in R5 FCALC... ithe final part of your program itaking inputs from R5 iand returning result Fin R7 MainLoop jmp Mainloop Infinite Loop MULT iIncluded in the skeleton code [2] for Main Program-[1] XCALC, [1] FCALC [5] for Factorial Subroutine 5] for Multiplication Subroutine

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions