Lab 2

 For this post I will be discussing lab 2 of SPO600,

This is lab is testing and modifying some code based on the 6502 assembler which can be found on this link http://6502.cdot.systems/

I will be testing the performance on the code and seeing how much memory it takes and the total run time.


Calculating Performance








I used a spread sheet in order to calculate the total time it will take to execute the program in ms and sec. The total time is not to long but it could be cut down. The fastest way I am thinking would be to cut down on the loops but I could not get it to work with out an error.

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
bne loop ; continue until done all pages

I was able to decrease the team by removing the first pointer, the low byte, getting rid of the current page number and the compare. This cuts down the time but now in half it wont make to much of difference. I tried to make it work with just one loop by thinking I could get the page and index to increment in the same loop but I could not figure out how. 




Modifying the Code



Change the code to fill the display with light blue instead of yellow. (Tip: you can find the colour codes on the 6502 Emulator page)

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 #$e ; colour number Set to blue.

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

Comments

Popular posts from this blog

SPO600 Lab1

SPO600(Project 3.2 FInal Post and thoughts on project and course)

SPO600(Project Part 2.1)