Posts

Showing posts from January, 2020

Lab 3: Bouncing Graphic (Part 1 - Calculate Pointer)

Image
Lab 3 Instruction The option my group choose is bouncing graphic. The instructions of this option are the following: Create a simple graphic in a square that is 5*5 or 7*7 pixels in size. Use the colors available in the emulator's bit-mapped display. The graphic could be a ball a happy face, a logo, an emoji, or anything else that you want to use Encode that graphic in bytes using DBC (declare constant byte) instructions Write code to make the graphic bounce around the screen, reflecting off the edges when it hits Make the speed keyboard-adjustable (faster/slower) and perturb the object's path once in a while This posting focuses on the explanation of the subroutine for calculating pointer. 1.1. Brief Flow Chart: Whole Project This is the first flow chart I created for this lab.It can be changed or improved in the future posting. 1.2. Flow Chart: Calculating Pointer 2.2. Define Descriptive Constants The define descriptive constants for this

Week 3: Reflection

Image
What I have learned this week 1. Learning the example code: Place a Graphic on the screen  1-1. Code Learning         define WIDTH        4        ; width of graph        define HEIGHT   4        ; height of graph                        lda                #$25                ; create a pointer at $10                        sta                $10                  ;   which points to where                        lda               #$02                ;   the graphic should be drawn                        sta               $11                   ;    the starting point: 0225 (first page, location 25)                      lda               #$00                ; number of rows we've drawn                      sta                $12                        ldx                #$00                ; index for data                        ldy                #$00                ; index for screen column           draw: lda                data, x                        sta    

Week 2: Lecture Reflection

Image
What I have learnt this week 1. How the bitmapped display consists When I look at the notes in a 6502 assembler in a website,  Pages $02 to $ 05 is bitmapped dispaly. The first page is $02 and the last one is $05. Each page has 0 - 255 (00 - ff) pixels. The top left is #$0200 and the top right is #$021f. The bottom left is #$05e0 and bottom right is #$05ff. When I store the pages, I should store the page location in a lower address and the page number in a higher address. For example, If you store  #$00 which is page location in $10 address, you should store page number #$02 in $11 address. 2. Status Register NV-BDIZC (1) N: Negative When you set the value type unsigned value, from 00 to 7f is positive value and 80 to ff is negative value. (2) V: Overflow It can be used when you set the value type unsigned. When the value becomes positive value to negative value or negative value to positive value, it will be flagged. Negative Value to Positive value. Overflow