spo600:6502_math_and_strings_lab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spo600:6502_math_and_strings_lab [2024/09/24 15:20] – [Write it!] chris | spo600:6502_math_and_strings_lab [2024/09/24 15:30] (current) – chris | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | #REDIRECT |
- | + | ||
- | In this lab, you will write code with arithmetic/ | + | |
- | + | ||
- | ===== Resources | + | |
- | * [[6502]] | + | |
- | * [[6502 Emulator]] | + | |
- | * [[6502 Math]] | + | |
- | * [[6502 Jumps, Branches, and Procedures]] | + | |
- | * [[6502 Emulator Example Code]] - Specifically: | + | |
- | * [[6502_Emulator_Example_Code#Place_a_Graphic_on_the_Screen|Place a Graphic on the Screen]] - for an example of defining a graphic using DCB, and copying a graphic to the screen | + | |
- | * | + | |
- | * [[https:// | + | |
- | * Wordle-like example (wordle-6502) | + | |
- | * Opcode/ | + | |
- | * [[http:// | + | |
- | * [[https:// | + | |
- | * [[https:// | + | |
- | ===== Tips and Techniques ===== | + | |
- | + | ||
- | * Keyboard | + | |
- | * Access the keyboard using the CHRIN [[6502_Emulator# | + | |
- | + | ||
- | * Random number generator | + | |
- | * A random byte is available at memory location $FE. | + | |
- | + | ||
- | * Drawing a Line | + | |
- | * To draw a line between two arbitrary points (X< | + | |
- | * Do something similar with run/rise where X< | + | |
- | * Suggestion: Use fixed-point math for the rise/run (aka deltaY) value. | + | |
- | + | ||
- | ===== | + | |
- | + | ||
- | ==== Decide What to Write ==== | + | |
- | + | ||
- | For this lab, write a program that meets these criteria: | + | |
- | - Your program must work in the [[6502 Emulator]] | + | |
- | - You must output to the character screen as well as the graphics (bitmapped) screen. | + | |
- | - You must accept user input from the keyboard in some form. | + | |
- | - You must use some arithmetic/ | + | |
- | + | ||
- | For example, you could write a simple game: | + | |
- | * [[https:// | + | |
- | * [[https:// | + | |
- | * [[https:// | + | |
- | * [[https:// | + | |
- | * A drawing program | + | |
- | * A maze | + | |
- | * A number guessing game (try to guess a random number in the shortest number of tries, getting feedback of "too high" or "too low" for each wrong guess) | + | |
- | * Or any other type of game... | + | |
- | + | ||
- | Or a calculator/ | + | |
- | * An adding or subtracting calculator | + | |
- | * A decimal-to-binary or hexidecimal-to-decimal converter | + | |
- | * A inches-and-feet to centimeter converter | + | |
- | * A [[https:// | + | |
- | * A program to draw bar or line graphs based on user input | + | |
- | * Or any other type of calculator or converter... | + | |
- | + | ||
- | **Or anything else that meets the criteria above** | + | |
- | + | ||
- | You can interact with the user using either display. For example: | + | |
- | * The main interaction could be on the graphical display, and instructions could be printed on the text display (which keys to use to move, for example); or | + | |
- | * The main interaction could be on the text display, and an appropriate pattern could be shown on the bitmap display (for example, a version of Wordle could display the words on the text display and the scoring of the guesses on the graphical display), or a calculator could use the text display for input and show a binary representation or a colour code on the graphical display (such as green for positive numbers, yellow for negative numbers, red for bad input). | + | |
- | + | ||
- | **Tip:** Keep it really simple! Assembly language is hard. Start simple, you can always add features later. | + | |
- | + | ||
- | ==== Write it! ==== | + | |
- | + | ||
- | Write the code for your selected program in the [[6502 Emulator]]. | + | |
- | + | ||
- | It can be helpful and fun to write this code with one or two other people in a live session. Acknowledge each person' | + | |
- | + | ||
- | **Remember to save your work periodically**, | + | |
- | + | ||
- | ** Acknowledge Other' | + | |
- | + | ||
- | **__Important__: | + | |
- | + | ||
- | ** You must write __at least two-thirds (67%) of the code__ in this lab, counted by lines of code. ** Do not take an existing program and just make minor changes to messages or colours. | + | |
- | + | ||
- | ==== Blog it ==== | + | |
- | + | ||
- | Write up your adventures in your blog. Remember to include the source code, some narrative about how it went, perhaps a screenshot of the program running, a reflection on the experience, and some ideas for further enhancement of the program. | + | |
- | + | ||
- | Ensure that your program works and is free from major bugs. Document any limitations or remaining minor bugs. | + | |
- | + | ||
- | Make sure that others (including your prof!) can run you code by pasting it into the [[6502 Emulator|emulator]] or loading it from a file (e.g., public git repository or downloadable file). | + | |
- | + | ||
- | Remember to follow the [[Blog Guidelines]] as you write. | + | |
- | + | ||
- | ==== Examples | + | |
- | + | ||
- | For some examples of games and demos, see the [[# | + |
spo600/6502_math_and_strings_lab.1727191210.txt.gz · Last modified: 2024/09/24 15:20 by chris