Lab 4B: Assembly 6502 String lab (option 4)

A. Introduction:

  • In this lab 4 for Assembly 6502 architecture, we will be making a program to receive 2 digits, add the received numbers and print the result
  • To view the code, please visit this pastebin link

B. Code explanation:

I. ROM routines and predefined variables:

  • ROM routines are builtin utilities that can assist you in string operations, more information can be found in Seneca CDOT wiki
  • Subsequently, there are predefined variables will be used throughout the program to store the colour to be filled, colour values, locations and so on

II. Draw menu:

  • After being initialized with starting values, the program will start printing out the menu for colour selections
  • By default, the screen will first be filled with black colour

III. Input loop:

  • The program will now loop to check whether the up or down arrow key is pressed. Additionally, it also check to see if the colour value is still in range from 0 to 15 (total 16 colors)
  • If the value is still in range, the value of colour variable stored in memory will be changed accordingly

IV. Fill screen:

  • Once we have the new colour value, we will perform a loop through each bitmap and fill every bit with the corresponding colour
  • After one bitmap is filled, we will move to the next bitmap and keep looping until all bitmaps are filled

V. Continue:

  • Next, the program will change the current colour on the list to the right and continue to wait for a new input from user to change the current value

Leave a comment