Changes

Jump to: navigation, search

6502 Assembly Language Math Lab

598 bytes added, 10:50, 13 September 2021
Techniques
** The last key pressed is stored in memory location $FF. Clear this location (to 0) after reading it. Printable characters, ENTER, and Backspace are represented by their ASCII codes; the arrow keys are represented by the codes $80-$83 (up/right/down/left).
* Random number generatorgeneratorFixed-pointA fixed-point value is encoded the same as an integer, except that some of the bits are fractional -- they're considered to be to the right of the "binary point" (binary version of "decimal point" - or more generically, the radix point). For example, binary 000001.00 is decimal 1.0, and 000001.11 is decimal 1.75.An alternative to fixed-point values is integer values in a smaller unit of measurement. For example, some accounting software may use integer values representing cents. For input and display purposes, dollar and cent values are converted to/from cent values.
** A random byte is available at memory location $FE.
* Drawing a Line
** To draw a line between two arbitrary points (X<sub>1</sub>,Y<sub>1</sub>)(X<sub>2</sub>,Y<sub>2</sub>) where X<sub>2</sub>-X<sub>1</sub> > Y<sub>2</sub>-Y</sub>1</sub> and all coordinates are positive, calculate the rise/run, then set Y=Y<sub>1</sub> and iterate for X=X<sub>1</sub>:X<sub>2</sub> incrementing Y by the rise/run each step.** Suggestion: Use fixed-point math for the rise/run (aka deltaY) value.
== Lab 3 ==

Navigation menu