Question: Task 1 : Calculating Dot Product In this task, you ll need to write a complete program to calculate the dot product of two vectors
Task : Calculating Dot Product
In this task, youll need to write a complete program to calculate the dot product of two vectors in assembly. You should write this program in a s file, and you should be able to assemblelinkexecute it using the QEMU emulator without any warning or error. For now we havent learned how to print numbers out to the terminal,
so you dont need to print out anything, and the CAs will check your code manually.
The data segment must be declared as follows:
data
vec: quad
vec: quad
dot: quad
where vec and vec are two vectors, and dot is where we store the dot product result. You must store the dot product into variable dot Theres no need to use loops; you can just hard code the offsets for now. You can always assume the vector length is
Requirements
Note your code is a complete assembly program not just a sequence of instructions It should be able to assemble, link, and execute without error and warnings. When executed, the program should finish without problems also without any outputs;
If your code cannot assemble, you get no credit this is the same as C programs that cannot be compiled;
MUL instruction can be used for multiplications;
Avoid using registers X and X;
You must store the dot product result into the variable dot ;
You have to put comments on each line of instruction;
Put your name and honor code pledge at the top of your code in comments.
Task : Debugging Assembly Using gdb
To check if our programs are correct, we would have to rely on gdb sorry still not printf yet! A very comprehensive tutorial of using gdb to debug assembly programs is in Appendix B of the textbook. Read through the section before you start this task.
In this task, youd need to write a report on using gdb to debug task You need to provide sufficient screenshots of gdb to show that your program is correct. Step into gdb and use commands to show that the result is correct.
Requirements
Simply one screenshot of showing the final result is not sufficient. For each step you took and command you typed on gdb you need a screenshot, and explain what youre trying to accomplish at that step. For example, setting a break point needs one; stepping into an instruction needs one, and so on;
You must use the correct command to show directly that the dotproduct calculation is correct and is stored back to memory;
The screenshots must not be pictures taken from your phone or camera;
The report needs to be in PDF format, with your name and honor code pledge at the top.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
