Instructor Notes
February 4, 2008
quote
"In from three to eight years we will have a machine with the general intelligence of an average human being." (Marvin Minsky, 1970)
Z80 assembly applied intro
review
- format of assembly code: label: opcode operands.
- First operand is destination
- registers (Z80 user's guide page A1-3)
- introduce only general-purpose, SP, PC for now
- Register's details: (A1-3 of Z80 user's guide)
- Accumulator
- HL: the 16-bit accumulator, sort-of
- DE, BC
- simple instructions
- NOP, DEC, INC, LD,
new material
- new opcodes: JP, JR, PUSH, POP, CALL, RET
- always pushes the high byte first so high byte is higher in memory
- the flag register (chap 5 Z80 user's guide). 6 flags
- conditional: Z flag
opcode: CP: CP C --> A - C
- example: loop for time delay
- KooPA page 30
- expand to 16 bit loop
- addressing modes: direct, indirect
special commands for the assembler
- ;
- include
- section "name",HOME[location]
- section "name",BSS[location]
- db
- EQU
- reference
GameBoy Architecture
get it all from gbspec.txt and gbhw.inc
Hello Video
- tiles, sprites
- window is 256x256 pixels = 32x32 tiles or sprites, screen is 160x144 pixels
- Tiles are ASCII character set, 8x8 pixels each starting at $8000 (Tile pattern table a.k.a. tile data table)
- Load tiles numbers into video memory, starting at $9800 (background tile map).
- We do not load the tiles themselves. Just the numbers.
- tiles are 16 bytes each, numbers are 1 byte each
- we cannot write to the background tile map or the title pattern table except between screen refreshes
Hello I/O
- I/O registers from $FF00 to $FF4B, and $FFFF
- timer, read joy pad, serial data, sound, video modes, window placement, etc.
Hello World
- walkthru of "hello world" code
IDE
download and install
- editor
- assembler
- emulator
- "hello world" test program
for another class
- instruction types
- addressing modes (TRS-80 book page 41 chap 3)
GameBoy applied intro
- interrupts
additional resources
- students need links and references for supporting materials to read outside of class