Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

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

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago