One thing that I've seen that can cause strange behavior is if you have an off-by-one error and are writing to the keyboard address. The CPU simulator sometimes feeds the data you wrote back to you as keyboard input!
If you want to, you can e-mail me your program and I'll take a look at it.
![](http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/file/n4028171/email.gif)
--Mark