Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Now that you leaned how to implement subroutines, convert your Vector-Vector Multiplication code implemented for HW3 to use a subroutine. The same data and

image text in transcribed

2. Now that you leaned how to implement subroutines, convert your Vector-Vector Multiplication code implemented for HW3 to use a subroutine. The same data and algorithm used for HW3 will be used. But this time, you will define a subroutine "vecMul" in a separate assembly file as described below . Create a new project and add a new assembly file "vector mul main s" to the project. a. Define main function in myCode cODE AREA b. The main function calls vecMul subroutine. To call vecMul that will be defined in another assembly file, you should use IMPORT directive (check the lecture slide) Pass the address of vector A as the first input parameter and the address of vector B as the second parameter to vecMul function. The first and second parameters should be passed via RO and R1, respectively The return value of vecMul should be stored in the variable C Define and initialize two 10-element integer arrays A and B, an integer variable C in DATA area just like you did for HW3 c. d. e. Add another new assembly file "vector mul subroutine.s" to the project. . Define a subroutine vecMul in mySubroutine CODE AREA. vecMul function runs the loop-based Vector-Vector Multiplication. To make this function visible by main function in another assembly file, you should use EXPORT directive (check the lecture slide) a. b. c. You can copy your HW3 code here. But, the two input parameters should be used as the base addresses of the two input vectors d. The multiplied result should be returned to main function via RO . Use any general-purpose register if needed. . Submit the vector mul main s and vector mul subroutine.s to the Canvas

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

5. A review of the key behaviors is included.

Answered: 1 week ago