Bài đăng

Đang hiển thị bài đăng từ Tháng 9, 2024

SPO600 - LAB 1: 6502 - Assembly Language Lab (Part 2) and Reflection

Hình ảnh
This blog discusses my experience with the 6502 assembly language through a series of experiments aimed at manipulating a bitmap display. In this lab, I investigated the effects of various assembly instructions on screen output, focussing on how shifting and incrementing values alter the colours displayed. I also completed additional challenges such as changing specific pixels to different colours and drawing lines around the screen's edge. Experiment 1. Add tya Before sta ($40),y The first experiment involves placing the tya instruction before the sta ($40),y. This transfers the value from the Y register to the A register, which determines the colour used to fill the screen. 2,  For each pixel, iny increments the Y register, and with tya, the value in the Y register is copied into the A register. The A register controls the pixel colour in the sta ($40),y instruction, so the screen is filled with colours based on the value of Y. This means that the colour of each pixel is directly...

SPO600 - LAB 1: 6502 - Assembly Language Lab (Part 1)

Hình ảnh
In this lab 1,  I have learnt basic 6502 assembly language and used an emulator to manipulate a bitmap display. I learnt how to calculate program execution time, optimize performance, and change code to achieve various visual effects. Bitmap Code In this step, I configure the emulator and run the initial code, which fills the screen with yellow pixels. 2. I copied and pasted the following assembly code into the 6502 Emulator : 3. Then I pressed the "Assemble" button and "Run" to assemble and execute the code, which successfully filled the screen with yellow pixels. - The code fills the bitmapped display with yellow by storing the yellow colour code (#07) at sequential memory addresses that correspond to pixels. - It employs indirect indexed addressing (sta ($40),y). with memory locations $40 and $41 pointing to the beginning of the display memory ($0200). - The iny instruction raises the index, looping through each pixel in a page, while bne keeps the loop running ...