Please follow the instructions carefully and deliver on time please
© 2021 Robin Pottathuparambil Page 1 of 2
Programming Assignment #4
CSCE 2610 - Assembly Language and Computer Organization
Summer 2021
100 Points
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_PA4 (example: xyz0202_PA4) 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 function to convert a given word to all lower case and find
the length of the given word. The base address of the input string (word) is passed
using register X1 and the resultant length should be stored in X0. Assume all the
registers are used by the main (caller) function to store some data before calling the
function. Write a main assembly function to test the assembly function. Create a static
character array (string) that is stored in the data section of the assembly code. Pass
the base address of the static array as an input to test the function and store the
returned value from the function in X20. 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)
2. A snail fell in a 300 meter well and wants to go back up. Every day it goes back up onehalf (1/2) of the distance that is left to go up. The total distance y the snail climbed back
in n days is computed by the equation 𝑦𝑦 = ∑ 300/2 𝑛𝑛 𝑥𝑥 𝑥𝑥=1 . The input n is in register X20
and is a non-zero positive integer less than 250. The output y should be stored in
register S20. Use single precision floating-point to compute y. 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 code. (25 Points)
3. Natural log of a value is computed as ln(1 + 𝑥𝑥) = ∑ (−1)(𝑛𝑛+1)
𝑥𝑥𝑛𝑛
𝑛𝑛
𝑎𝑎
𝑛𝑛=1 . Write a ARMv8
assembly program to compute natural log of a value. Assume the input x is in D20
and the input a is in X20. Store the result in D21. The user input x is a double precision
floating-point value between 0.0 and 5.0. The user input a is a 64-bit non-negative
© 2021 Robin Pottathuparambil Page 2 of 2
integer less than 5000. Use double precision floating-point for the computation.
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 code. (40 Points)
An example assembly code (string_code.S and first_fp.S) is posted on canvas to jump
start your assignment.
Deliverables:
1. Commented assembly code for question 1, 2, and 3
2. A readme file that describes how to compile, execute, and test the assembly code.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of