Question: The example mentioned in the question(in black) 1. [60] Write a Y86-64 program that sorts an array of longs (10) Allocate a hardcoded input array
![The example mentioned in the question(in black) 1. [60] Write a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66e2d936ea217_77466e2d93654886.jpg)

The example mentioned in the question(in black)
1. [60] Write a Y86-64 program that sorts an array of longs (10) Allocate a hardcoded input array similar to that used by asum.ys (linked on course examples page) with at least 10 entries. (20) Implement a swap procedure equivalent to the following C code: void swap (long *xp, long *yp) i long t0 = *xp; long tlypi xp-tl; *yp = to; (20) Implement a sort procedure that sorts the input array using Bubble Sort. Your sort procedure should call your swap procedure to perform the swaps and it should sort the array in place - there's no need to allocate additional memory for an output array. .(10) Implement a main procedure to call your sort procedure, passing the input array and array length as arguments. I recommend using the "Y86-64 simulator" (linked on the course Links page) as a programming environment. Use the Y86-64 examples from class and the textbook as a guide Hint: Y86-64 doesn't have leaq or mult (or shifts, for that matter), so calculating a pointer from a base address and index is kinda a pain... Instead, consider using pointer arithmetic like we did back in assignment 4! Hint: Y86-64 doesn't have cmpq or testq, either; subq will do the trick, but be careful with the side effects! Name your source file 5-1.ys
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
