Question: 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

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!