Open main menu

CDOT Wiki β

Changes

6502 Assembly Language Math Lab

246 bytes added, 12:32, 28 January 2022
no edit summary
[[Category:SPO600 Labs- Retired]]{{Admon/important|This lab is not used in the current semester.|Please refer to the other labs in the [[:Category:SPO600 Labs|SPO600 Labs]] category.}} {{Admon/lab|Purpose of this Lab|In this lab, you will write code with arithmetic/math in [[6502]] assembly language, in preparation for learning more complex x86_64 and AArch64 assembly language.}}
== Resources ==
3. Select and complete one of these options for this lab:
==== Option I1: Bouncing Graphic ====
# Create a simple graphic in a square that is 5x5 or 7x7 pixels in size. Use the colours available in the emulator's bitmapped display. The graphic could be a ball, a happy face, a logo, an emoji, or anything else (appropriate!) that you want to use.
# Encode that graphic in bytes using DCB (declare constant byte) instructions.
# Write code to make the graphic bounce around the screen, reflecting off the edges when it hits. Note: for simplicity, it is OK if the object always bounces at 45-degree angles.
# Make the speed keyboard-adjustable (faster/slower) and perturb the object's path once in a while(add a glitch - adjust the angle or nudge the obect by a pixel at random intervals).
Challenge: randomize the starting position, and make the object bounce at angles other than 45 degrees.
#* Find alternate patterns on the web, or
#* Design your own font patterns
# Encode the font patterns for these characters using DCB (declare constant byte) instructionsdirectives.
# Write code to display a 2-digit unsigned decimal number (0-99). The + and - keys should increment and decrement this number.
Challenge: extend the code to suppress leading zeros and display a signed number (-99 to +99).