Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Y86-64 program sum.ys that iteratively sums the elements of a linked lis

ID: 3593289 • Letter: W

Question

Write a Y86-64 program sum.ys that iteratively sums the elements of a linked list. Your program should
consist of some code that sets up the stack structure, invokes a function, and then halts. In this case,
the function should be Y86-64 code for a function (sum list) that is functionally equivalent to the C
sum list function in Figure 1. Test your program using the following three-element list:
# Sample linked list
.align 8
ele1:
.quad 0x00d
.quad ele2
ele2:
.quad 0x0e0
.quad ele3
ele3:
2
.quad 0xf00
.quad 0

For the data provided in the writeup, the program sum.ys will be considered correct if the graders do not spot any errors in them, and the sum list function returns the sum 0xfed in register %rax.

Explanation / Answer

.align 8
ele1:
.quad 0x00d
.quad ele2
ele2:
.quad 0x0e0
.quad ele3
ele3:
2
.quad 0xf00
.quad 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote