Posts

Showing posts from March, 2022

6502 Assembly Language

Image
 Part 1: Introduction Through this blog post, I will be learning about the 6502 assembly language. I will be learning basic operations and features of the language, as well as how to calculate a portion of code's execution time. I will be focusing on the below code snippet while exploring how to make changes for desired output and better performance. 👉 The following 6502 emulator will be used to run code throughout this lab:  http://6502.cdot.systems/ Initial Code:           lda #$00 ; set a pointer at $40 to point to $0200 sta $40 lda #$02 sta $41 lda #$07 ; colour number ldy #$00 ; set index to 0 loop: sta ($40),y ; set pixel at the address (pointer)+Y iny ; increment index bne loop ; continue until done the page inc $41 ; increment the page ldx $41 ; get the current page number cpx #$06 ; compare with 6 bne loop ; continue until done all pages The above code fills the emulator's graphics screen with the colour yellow. Output: How this code works: The firs