+1 (208) 254-6996 [email protected]
  

its a coding assignmentΒ 

Β© 2021 Robin Pottathuparambil Page 1 of 2

Don't use plagiarized sources. Get Your Custom Essay on
Programming Assignment 2
Just from $13/Page
Order Essay

Programming Assignment #2 CSCE 2610 – Assembly Language and Computer Organization

Summer 2021

100 Points Due: 06/23/2021, 11:55 PM

Instructions: Compile and simulate the assembly programs (.S file) using DS-5 simulator and make sure it’s working. Comment your assembly programs. Create an assignment folder with folder name as euid_PA2 (example: xyz0202_PA2) and add all the source files (.S file) and the readme file to the folder. Please create a zip archive of your assignment folder and upload the zip file to Canvas. Not following the above instructions could result in not accepting your work. Late submissions are not allowed.

1. Write an ARMv8 assembly code to compute the sum of first n natural numbers. Assume the value of n is stored in register X20 and is a 64-bit non-zero positive integer. Store the computed sum in X21. Do not use divide and branch instructions in your code. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. Only upload the assembly file (.S file) from the DS-5 project to Canvas. Comment your assembly code. (10 Points)

2. Write an ARMv8 assembly code to compute the value of y from the equation 𝑦𝑦 = π‘Žπ‘Žπ‘₯π‘₯2 + 𝑏𝑏π‘₯π‘₯ βˆ’ 𝑐𝑐. Assume variables a, b, c, and x are stored in registers X20, X21, X22, and X23 respectively and are 64-bit non-zero positive integers. Store the computed value of y in X24. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. Only upload the assembly file (.S file) from the DS-5 project to Canvas. Comment your assembly code. (15 Points)

3. Write an ARMv8 assembly code to compute the sum, mean, median, and range of four

64-bit sorted values. The four values are sorted in ascending order and are stored as a static array in the data section. Compute the sum, mean, median, and range and store the values in X20, X21, X22, and X23 respectively. Assume all the input values are 64-bit non-zero positive integers. Do not use divide and branch instructions in your code. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. Only upload the assembly file (.S file) from the DS-5 project to Canvas. Comment your assembly code. (35 Points)

4. Convert the below C code snippet to ARMv8 assembly code. Assume variables a, b, and c are stored in registers X20, X21, and X22 respectively and the array x is stored as a static array in the data section. Assume all the input values are 64-bit non-zero

Β© 2021 Robin Pottathuparambil Page 2 of 2

positive integers. Do not use divide and multiply instructions in your code. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. Only upload the assembly file (.S file) from the DS-5 project to Canvas. Comment your assembly code. (40 Points)

c = a – b; x[1] = c + x[2]; x[c] = x[2*a] + x[b/2]; x[b/4] = x[c] + (a << 4);

Deliverables:

1. Commented assembly code for question 1, 2, 3, and 4 2. A readme file that describes how to compile, execute, and test the assembly code.

Order your essay today and save 10% with the discount code ESSAYHELP