Posts

Showing posts from May, 2024

Lab-3

  Exploring Assembly Language on x86_64 and AArch64 Introduction In this lab, we dive into the intricacies of assembler on both x86_64 and AArch64 architectures. We'll explore code examples, disassemble object files, and write simple assembly programs to understand the core differences and functionalities between these architectures. Setting Up First, we unpacked the provided code examples: cd ~ tar xvf /public/spo600-assembler-lab-examples.tgz This created a directory structure under  ~/spo600/examples/ , containing various examples in C and assembly for both architectures. Building and Running C Programs We started with the C programs to establish a baseline: Building the C programs: cd ~/spo600/examples/c make Running the C programs: ./hello ./hello2 ./hello3 Observing the differences: hello.c  uses  printf() . hello2.c  uses  write() . hello3.c  uses  syscall()  directly. Disassembling C Binaries Using  objdump , we disassembled th...

My Journey into Learning 6502 Assembly and Beyond

Learning 6502 assembly language has been both hard and fun. I love old computers, and this has helped me understand how they work better. Here's what I've learned and done, from 6502 assembly to modern 64-bit assembly languages like AArch64 and x86_64. Discovering the 6502 Microprocessor The 6502 microprocessor was used in famous old devices like the Apple II and the NES. It's simple and a great way to learn low-level programming. I started with flow control and math operations. Flow Control in 6502 Assembly Flow control is about controlling where the program goes. The main tools are: JMP (Jump):  Go to a new place in the program. Branches (Bxx):  Go to a new place if a condition is met. Subroutines (JSR and RTS):  Call and return from a function. These tools help make loops, decisions, and reusable code. Writing a loop or a function was like putting together a puzzle. Mastering Math Operations The 6502 can do basic math directly: ADC (Add with Carry):  Add numbers. ...

Exploring Retro Arcade Days - Simple Yet Challenging Breakout

Lab-2  Introduction  In this lab I got to explore and relive the experience that my dad gained . I wanted to build a game in 6502 assembly language using an online emulator . With the help of online resources and YouTube tutorials , I managed to create a simple game  Concept To experiment , I chose a simple breakout game in which the player has to judge an incoming ball(pixel) , which bounces off of a platform . Player can reposition the platform along the X-axis and the velocity of the ball increase each time it bounces off the platform. Player earns a point each time the ball bounces off the platform . Game ends when the ball hits the bottom of the screen . Development Process Using a 6502 assembly language emulator and a text editor, I began writing the code for my game. I defined variables for the ball's position, velocity, paddle size, score, and collision detection flags. Then, I set up the initial game state, including placing the ball and paddle on the screen. Nex...

Exploring Assembly Language (Lab-1)

Introduction: In the realm of computer programming and analysis, delving into assembly language can be both daunting and exhilarating. As a student at Seneca in computer programming and analysis, I recently embarked on a lab journey exploring the intricacies of assembly language, particularly focusing on the 6502 architecture. In this blog post, I'll share my experiences, discoveries, and insights gained from the lab experiments. Calculating Performance and Modifying Code: In one of the lab experiments, I initially tackled the task of calculating the execution time of a code snippet aimed at filling a bitmapped display with a solid color. After analyzing the code and considering a clock speed of 1 MHz, I calculated the execution time to be approximately 1.321 milliseconds. This involved dissecting the assembly code, understanding the purpose of each instruction, and considering optimization techniques. Here is the original code : lda #$00      ; Load accumulator with lo...