Posts

Showing posts from February, 2025

LAB5

Image
 INTRODUCTION This lab is about exploring assembly language on x86_64 and AArch64 architectures. We will start by running "Hello World" programs written in C and assembly, then use tools like objdump and gcc -S to examine machine code and compiler-generated assembly. The main task is to modify an AArch64 assembly loop to print numbers, first from 0 to 5, then extending it to 00-32 with two-digit formatting, and finally converting it to hexadecimal. After that, we will repeat similar steps for x86_64 assembly. The goal is to understand how low-level programming works, compare different architectures, and gain experience with assembly instructions, system calls, and debugging. Extracting the Archive First, we need to unpack the tar archive on x86_64 and AArch64 using the command: tar xvf /public/spo600-assembler-lab-examples.tgz (AArch64) (x86_64) Building and Running the C Program on x86_64 and AArch64 Building and running the C program using make command. Disassembling Machin...

LAB 4

Image
Building GCC process: Step 1: Create a Directory for the GCC Source Code: Step 2: Clone the GCC Repository into the Source Directory:  Step 3: Create a Separate Build Directory Note: Building GCC directly in its source code directory is not recommended. Doing so can mix original source files with new files created during the build process, making it hard to manage the code. This can also cause problems with version control systems, which track changes in the code. To avoid these issues, it's better to create a separate directory for building GCC. This keeps the original source code clean and makes it easier to manage different build versions. For example, you can create a directory named gcc-build next to your GCC source code directory and perform the build process there. Step 4: Configure the Build Note: --prefix option specifies the installation directory for GCC after the build process. In this case, GCC will be installed in ~/gcc-test-001. gcc-build-001 Directory: Purpose: This...