Posts

Showing posts with the label Lab4

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...