Posts

Showing posts with the label 6502 Assembly

Lab 4 (6502 Assembly Language String Lab): Option 1: Adding Calculator

Introduction In this posting, I will describe a design and implementation for option 1, lab 4: Adding Calculator. There is a previous posting to describe a code for option 4: Screen Colour Selector . Option 1: Adding Calculator Create a subroutine which enables the user to enter two numbers of up to two digits. Indicate where the cursor is, and allow the user to use the digit keys (0-9), backspace, and enter keys. Return the user's input value in the accumulator (A) register. Using this subroutine, write a program which adds the two numbers (each of which is in the range 0-99) and print the result. The detailed instruction for this lab is demonstrated here . 1. Design 1.1. Pseudo Code Store "Enter the first number", "Enter the second number", "result" to output on the screen Print the "Enter the first number: " Receive the first number from the user. User can use enter to store the number and backspace to erase a number Store...

Lab 4 (6502 Assembly Language String Lab) - Option 4: Screen Colour Selector

Introduction For lab 4, I can choose two options among four options. My team chose the first and fourth options which are adding calculator and screen colour selector. This post is for the fourth option "Screen Colour Selector". The instruction of option 4 is written below. Option 4: Screen Colour Selector Instruction Create a subroutine which displays on the character display a list of colours available on the bitmapped display, one colour per line, with one of the names of the colours highlighted in reverse video (white on black). The user may use the up/down arrow keys to change the highlighted row. Return the user's selection as a number in the accumulator (A) register when they press Enter. Using this subroutine, get a colour from the user, then fill the bitmap display with this colour, and allow the user to select a different colour. 1. Design 1.1. Pseudo Code Initialize values get the key (up/down key) check whether the colour needs to be increase...

Lab 3: Bouncing Graph - Done

Image
Introduction In this post, I will show how to do the lab 3: bouncing graphic. The code can be upgraded when I discover an error but the bouncing and moving a ball and applying keyboard part have done. You can understand more this posting if you read my previous postings: Lab 3: Bouncing Graphic (Part 1 - Calculate Pointer) and Lab 3: Bouncing Graph - Drawing and Moving Graph in the Pointer Location . The detailed lab 3 instruction is written below. 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 spe...