Instructor Notes
March 31, 2008
Programmers
- directory and all files must be writable
- apparently doesn't work with Vista?
the behavior of the emulator is not identical to that of a real GameBoy
- keyboard bouncing
- window behavior
- random program
Hello Noise assignments
Random
- demonstrates programming techniques
- modular programming
- standard-defs.inc
- keypad.asm
- print-number.asm
- modular programming
- subtraction using 2s complement addition
- using INC_SS, DEC_SS macros
- using shift and rotate for multiplying and dividing by powers of 2
- use this technique to get the desired range for your random number
- using the carry flag
Hello Angle
- lookup tables
- main loop and the timer
Programming conventions
- subroutines and macros preserve registers
- pick good label names
- use local variables whenever possible
- don't overMACROize
- ALL CAPS for macros and constants
- avoid hard-coding. From good to bad:
- find a function, usually involving a loop, which calculates what you want
- print-number.asm
- make a lookup table and an indexing system to look up what you want
- hello-angle.asm
- hard-code --- but only for very simple examples and for trying out ideas.
- hello-noise.asm
- find a function, usually involving a loop, which calculates what you want