Every time I have a program that writes to $0200, the program crashes. I'm trying to write a byte to memory address $0200.
I'm using a standard emulator (I've tried VICE for C64 and another generic 6502 emulator) The problematic section seems to be:
LDA #$42
STA $0200
$0200 is an input buffer used by CBM Basic. You should avoid using this memory section unless you disable Basic ROM. Please see the links below for more details.
Check Extended Zeropage section for $0200 address:
http://unusedino.de/ec64/technical/aay/c64/zpmain.htm
For enabling/disabling Basic and other ROMs:
http://unusedino.de/ec64/technical/aay/c64/memcfg.htm