Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a) Write an assembly program that first initializes two 16-bit signed integers, Items and Cost. This program will be responsible for passing data to the
a) Write an assembly program that first initializes two 16-bit signed integers, Items and Cost. This program will be responsible for passing data to the two subroutines created in part b and part c of this assignment.
b) Create a subroutine, called SW_COST, that determines the total price of a customers order by multiplying the number of items by the cost per item. You may use the multiplication technique of your choice (some algorithm examples can be found here:
http://en.wikipedia.org/wiki/Multiplication_algorithm). The parameters (Items and Cost) should be passed to the subroutine using registers and the result stored in R12.
c) Create a second subroutine, called HW_COST, that determines the cost of a customers order using the hardware multiplier. The parameters (Items and Cost) should be passed to the subroutine using the stack and the result should be stored in R14.
d) Assess the performance of the subroutines by monitoring the clock cycle counter in the IAR Workbench for both subroutines. Include these clock cycle counts as part of your lab submission.
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