spo600:6502_assembly_language_lab
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spo600:6502_assembly_language_lab [2024/05/08 03:55] – [Modifying the Code] chris | spo600:6502_assembly_language_lab [2025/01/10 21:22] (current) – [Calculating Performance] chris | ||
---|---|---|---|
Line 11: | Line 11: | ||
* [[6502 Addressing Modes]] | * [[6502 Addressing Modes]] | ||
* External | * External | ||
+ | * [[https:// | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
* Video | * Video | ||
- | * [[https://web.microsoftstream.com/video/ed7aedf1-fe6f-4b72-bbf1-c9b4e6e80af9|Calculating 6502 Program Execution Time]] | + | * [[https://seneca-my.sharepoint.com/:v:/g/ |
===== Lab 1 ===== | ===== Lab 1 ===== | ||
Line 42: | Line 44: | ||
- | 3. Test the code by pressing the Assemble button, then the Run button. If the there are any errors assembling (compiling) the code, they will appear in the message area at the bottom of the page. Make sure the code is running correctly and that you understands how it works. Don't be afraid to experiment! | + | 3. Test the code by pressing the '' |
==== Calculating Performance | ==== Calculating Performance | ||
Line 48: | Line 50: | ||
**This is the key part of the lab.** | **This is the key part of the lab.** | ||
- | 4. Calculate how long it takes for the code to execute, assuming a 1 MHz clock speed. | + | 4. Calculate how long it takes for the code to execute, assuming a 1 MHz clock speed. |
+ | |||
+ | Tip: The most common problem with performance analysis | ||
5. Also calculate the total memory usage for the program code plus any pointers or variables. | 5. Also calculate the total memory usage for the program code plus any pointers or variables. | ||
- | Refer to the video on [[https://web.microsoftstream.com/video/ed7aedf1-fe6f-4b72-bbf1-c9b4e6e80af9|Calculating 6502 Program Execution Time]] for instructions on how to do this. Note that the example in the video is colouring only 1/4 of the bitmapped display, not the entire bitmapped screen - your result will be longer and different. | + | Refer to the video on [[https://seneca-my.sharepoint.com/:v:/g/ |
- | Tip: The most common problem | + | 6. **Find one or more ways to decrease the time taken to fill the screen |
- | 6. Find one or more ways to decrease | + | ==== Modifying |
- | ==== Modifying the Code ==== | ||
7. Change the code to fill the display with light blue instead of yellow. (Tip: you can find the colour codes on the [[6502 Emulator]] page). | 7. Change the code to fill the display with light blue instead of yellow. (Tip: you can find the colour codes on the [[6502 Emulator]] page). | ||
8. Change the code to fill the display with a different colour on each page (each " | 8. Change the code to fill the display with a different colour on each page (each " | ||
- | ---- | + | 9. Make each pixel a random colour. (Hint: use the psudo-random number generator mentioned on the [[6502 Emulator]] page). |
- | **========== This is the end of the in-class portion of the lab. ==========** | + | |
- | ---- | + | |
- | ==== Experiments | + | ==== Experiments |
Go back to the bitmap code above, and try these experiments: | Go back to the bitmap code above, and try these experiments: | ||
Line 74: | Line 75: | ||
- Add this instruction after the '' | - Add this instruction after the '' | ||
- What visual effect does this cause, and how many colours are on the screen? Why? | - What visual effect does this cause, and how many colours are on the screen? Why? | ||
- | - Repeat the above tests with two, three, four, and five '' | + | - Repeat the above tests with two, three, four, and five '' |
- Repeat the tests using '' | - Repeat the tests using '' | ||
- Revert to the original code. | - Revert to the original code. | ||
- The original code includes one '' | - The original code includes one '' | ||
- Revert to the original code. | - Revert to the original code. | ||
- | - Make each pixel a random colour. (Hint: use the psudo-random number generator mentioned on the [[6502 Emulator]] page). | + | |
==== Challenges (Optional, Recommended) | ==== Challenges (Optional, Recommended) | ||
Line 95: | Line 96: | ||
- An introduction, | - An introduction, | ||
- The results from the // | - The results from the // | ||
+ | - Any significant code in a form that allows it to be tested. | ||
+ | - In the case of this lab, this is the version of the software that you've modified to improve performance. | ||
+ | - This code should be either (a) directly included in the blog in a form where it can be easily cut-and-pasted into the emulator for testing, or (b) in a repository so it can be easily cut-and-pasted or downloaded for testing. (Recommendation: | ||
- The results of the Optional sections, if you performed them, and your explaination for each observed result. | - The results of the Optional sections, if you performed them, and your explaination for each observed result. | ||
- Your experiences with this lab -- your impressions of Assembly Language, what you learned, and your reflections on the process. | - Your experiences with this lab -- your impressions of Assembly Language, what you learned, and your reflections on the process. |
spo600/6502_assembly_language_lab.1715140500.txt.gz · Last modified: 2024/05/08 07:55 (external edit)