Posts

Showing posts from November, 2022

Lab 5 - Algorithm Selection Lab

In this lab, I wrote a set of programs that generates sound samples in a data array. It generates 5000000 samples as specified in the provided "vol.h" file, then scales the samples by a factor of 0.75 and returns them to the array. As a result, the program generates and displays a sum from the output array. To test the run time for each program, we'll use the command "time./programName," which will run the program and output the results as well as the time it took to run it. The program's real time is the sum of two sections: "user time" and "system time." Task 1: I obtained the base run time data we will work with when I ran the initial program, "vol1." This program runs with the volume factor unchanged. This allows us to test the other programs and observe any significant changes in run time data. Running the same program will not always produce the same results; there may be slight differences. This could be due to initial r

Lab 4 - Part 2 (x86_64)

In this section, I must write the same programme for the x86 64 platform. This was a little difficult for me because I found aarch64 syntax to be simpler and easier to understand than x86 64 syntax.  While writing the code for x86_64, I followed a similar procedure. I first printed the loop 10 times without printing the loop counter. I tried it, and it worked on the first try. However, implementing the loop counter proved to be somewhat difficult. I was able to implement it, but when I was storing the count in location #, instead of storing a single byte, it was storing a qword, which overwrote n, and the output was in a single line. To solve the problem, I suffixed the command and registered with b. Here's my code: .text .globl _start min = 0 /* starting value for the loop index; note that this is a symbol (constant), not a variable */ max = 10 /* loop exits when the index hits this number (loop condition is i<max) */ _start:

Lab 4 - Part 1 (AArch64)

 This lab is based on an introduction to 64 bit Assembly language for aarch64 and x86 64. In this lab, I'll be working with assembly language on both the x86 64 and aarch64 platforms. To access these platforms, we must use SSH servers to connect to two servers provided by the professor. The first server is Israel, which runs on an aarch64 system, and the second server is Portugal, which runs on an x86 64 system.  The first task is to compile and run aarch64 programs. I connected to the Israel server and configured some settings for it. After that, I was given some examples to work with.  Then, from 0 to 9, we must create a loop and print the word with each increment along with the increment counter. We were given a loop template that did not include the loop body. In aarch64, the value 64 is used to invoke the write method. In the second step, I copied the value from r19 to a new register and prefixed it with '0' to convert it to ascii, then I moved that value to the locati