Posts

Showing posts from October, 2024

Lab1

Image
  Lab 1: 6502 Assembly Language Lab Introduction In this lab, we explore 6502 assembly language using a processor emulator. The 6502 is a well-known 8-bit microprocessor, and understanding its low-level architecture will allow us to grasp fundamental programming concepts, including memory management and CPU cycles. In this exercise, we wrote and optimized an assembly program that fills the screen with color. We then calculate execution time, memory usage, and modify the code to achieve specific outcomes. Setup To follow this lab, we used the 6502 Emulator .  Bitmap Code The following code fills the screen with the color yellow by pointing to memory at $0200 and incrementally writing the color to every pixel.     lda #$00        ; Load $00 into accumulator (low byte of pointer)     sta $40         ; Store low byte in address $40     lda #$02        ; Load $02 into accumulator (high b...