一站式論文代寫,英国、美国、澳洲留学生Essay代寫—FreePass代写

匯編代寫 - Y86-64
時間:2020-11-11
Please submit individual source files for coding exercises (see naming conventions below) and a single solution document for non-coding exercises (.txt or .pdf only). Your code and answers need to be documented to the point that the graders can understand your thought process. Full credit will not be awarded if sufficient work is not shown. 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) { long t0 = *xp; long t1 = *yp; *xp = t1; *yp = t0; } ? (20) Implement a sort procedure that takes a pointer to an array and length of the array as arguments and sorts the input array using Selection Sort. Your sort procedure should call your swap procedure (using a call instruction) 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 (using a call instruction), 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. 2. [20] Draw a circuit (using AND, OR, and/or NOT gates) with inputs A, B, C, and D and one output such that the output is on only if A is on and B is off or C is on and D is off (e.g., (A && !B) || (C && !D)). See Figure 4.10 for an example. Include your answer in your solutions document (a picture of a drawing is sufficient). Label your inputs! 3. [20] In our example Y86-64 programs, such as the Sum function shown in Figure 4.6, we encounter many cases (e.g., lines 2 and 10) in which we want to add a constant value to a register. This requires first using an irmovq instruction to set a register to the constant, and then an addq instruction to add this value to the destination register. Using Figure 4.18 as a guide, draw a diagram expressing how the existing Y86-64 architecture could implement a new iaddq instruction to accomplish this functionality. Write your answer in your solutions document. Zip the source files and solution document (if applicable), name the .zip file Assignment5.zip (e.g., EricWillsAssignment5.zip), and upload the .zip file to Canvas (see Assignments section for submission link).

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
专业essay代写|留学生论文,作业,网课,考试|代做功課服務-PROESSAY HKG 专业留学Essay|Assignment代写|毕业论文代写-rushmyessay,绝对靠谱负责 代写essay,代写assignment,「立减5%」网课代修-Australiaway 代写essay,代写assignment,代写PAPER,留学生论文代写网 毕业论文代写,代写paper,北美CS代写-编程代码,代写金融-第一代写网 作业代写:CS代写|代写论文|统计,数学,物理代写-天天论文网 提供高质量的essay代写,Paper代写,留学作业代写-天才代写 全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack