Working on a 6502 emulator.
Once assembled and linked, the image can be run through the emulator:
.word nmi, reset, irq
The 'brk' instruction is executed, which pushes the current program counter and processor flags to the stack, and jumps to the BRK ISR (the 16 bit address to the BRK ISR is given at 0xFFFE in the 6502 architecture).
The opcode $A9 is the 'lda #$DE' (the first instruction of the BRK ISR). I haven't implemented lda yet, so that's why it's saying illegal opcode.
The source is here if anyone's interested: http://github.com/charliesome/6502. I'm hoping to get to a point where my emulator can run Apple II or Commodore 64 programs, although that's a long way off.