Posts

Showing posts from March, 2025

Lab 5: Exploring Assembly Language on x86_64 and AArch64 Architectures

Introduction In this blog post, I’ll share my experience working with assembly language on both x86_64 and AArch64 architectures as part of the SPO600 lab. This lab was an eye-opening journey into the low-level world of programming, where I got to write, debug, and optimize assembly code. I’ll walk you through the steps I took, the challenges I faced, and my thoughts on working with different assembly languages. 1. Getting Started with the Lab The lab began with unpacking the provided archive containing example programs in both C and assembly language. The directory structure was well-organized, with separate folders for x86_64 and AArch64 assembly code, as well as portable C versions for comparison. Using the tar command, I extracted the archive and explored the files. The first step was to build and run the C versions of the "Hello World" program on both architectures. This helped me understand the differences in the generated binaries and the underlying system calls. Using...

Lab-4: GCC Build Lab - Building the GCC Compiler from Source

Introduction In this lab, I explored the process of building a large software project—specifically, the GCC (GNU Compiler Collection) compiler—from source code. GCC is a critical toolchain used for compiling programs in various programming languages, including C, C++, and Fortran. The goal of this lab was to understand the build process, use tools like make and autotools , and compare the performance of the build process on two different architectures: x86-001 (x86_64) and aarch64-002 (ARM64). This lab is part of the SPO600 course, where we study software portability and optimization. Lab Steps and Results 1. Obtaining and Building GCC I followed these steps to build GCC on both servers: Cloned the GCC source code: git clone git://gcc.gnu.org/git/gcc.git gcc-source Created a separate build directory and configured the build: mkdir gcc-build cd gcc-build ../gcc-source/configure --prefix=$HOME/gcc-install --disable-multilib Built GCC using make: time make -j 16 |& tee build.log In...

Lab-3 Creating a Number Guessing Game in 6502 Assembly

Image
Introduction For this lab, I decided to create a simple Number Guessing Game using the 6502 Emulator. The game generates a random number between 0 and 9, and the player has 3 attempts to guess the correct number. The program outputs instructions and feedback to the character screen and displays a visual representation of the game's progress on the bitmapped screen . This project was a great way to explore 6502 assembly language, including handling user input, performing arithmetic operations, and managing both text and graphical displays. Program Overview The program meets all the lab requirements: Output to Character Screen : Displays instructions, remaining guesses, and feedback (e.g., "Too high" or "Too low"). Output to Bitmapped Screen : Shows a visual representation of the game's progress, such as a smiley face for a win or a sad face for a loss. User Input : Accepts numeric input from the keyboard (0-9). Arithmetic/Math Instructions : Uses subtractio...