6502 Assembly Language Lab
Lab 2 Tim Lin 2. This week the professor let us practice using the 6502 simulators. Run the following code. lda #$00 ; set a pointer in memory location $40 to point to $0200 sta $40 ; ... low byte ($00) goes in address $40 lda #$02 sta $41 ; ... high byte ($02) goes into address $41 lda #$07 ; colour number ldy #$00 ; set index to 0 loop: sta ($40),y ; set pixel colour at the address (pointer)+Y iny ; increment index bne loop ; continue until done the page (256 pixels) inc $41 ; increment the page ldx $41 ; get the current page number cpx #$06 ; compare with 6 bne loop ; continue until done all pages 4. Calculate how long it takes for the code to execute . 6. Change the code to fill the display with light blue instead of yellow. lda #$07 change to lda #$e lda #$00 ; sta $40 ; lda #$02 sta $41 ; lda #$e ; ldy #$00 ; loop: sta ($40),y ; iny ; bne loop ; inc $41...