SPO600 Lab 2
Lab 2, where I have a given 6502 assembly 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 My job is to play around with the code, calculate the performance of the given code, and try to optimize the code to have a better performance. First, starting to run the code on http://6502.cdot.systems/ - a website that stimulates a 6502 emulator, I got a result of a yellow screen, which consists of 4 pages. Let's look at the performance by calculating the number of cycles and cycle count. We will do this on Microsoft Excel to have a clear perspective. After doing some calculations on Excel, I got a result of 0.012 seconds. How did I fin