Lab 2 part 2

 

Modifying the Code


Change the code to fill the display with a different colour on each page (each "page" will be one-quarter of the bitmapped display).



For this part of the Lab we were tasked to change the 4 pages to different colors. The way that i accomplished this was through research and finding and testing a command called "ASL" this means arithmetic shift left. Once this is set after the done the page bne it will shift the color in memory and print the even color. There is another way to perform this task by making individual for loops and changing the color value. I found this way to be easy and cool once understood.




      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 #$05 ; 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)
asl
        inc $41 ; increment the page
ldx $41 ; get the current page number
cpx #$06 ; compare with 6
bne loop ; continue until done all pages


Thoughts about the lab

This was the first lab we had the chance to work with assembly and I thought it was a bit challenging to understand the syntax but once you can find the resources and use class notes it became a lot easier to understand. In order to complete the color change that was pretty ease for the first part of the lab. The hard part was to change the 4 pages. I tried for a a while to first understand the syntax and to at first just make the first page turn yellow and stop. After understand how the loop and syntax was working I was able to make the pages change. Then I found a command that could do it very simply once I understood what the command was doing and where to implement the command which was "ASL"

Over all I liked to work with the 6502 console and am looking forward to learn more about this language. I just again found it a bit hard to first understand the syntax.

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)