Re: Stuck on CPU implementation

Posted by WBahn on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Stuck-on-CPU-implementation-tp4032304p4037097.html

You can also break things down into smaller chunks. For instance, you might start out by only working with operations that only write to the D register (i.e., don't read from any registers, so instructions like D=0, D=1, and D=-1). Then add instructions that also read from the D register (like D=D+1). At that point, you could either expand by including instructions that read from the A register, or by including instructions that write to the A register.

At each step, add a set of instructions that all have one thing in common so that you can just focus on that one thing. Be sure to test that your added instructions work correctly AND that you didn't do anything to break the instructions that had already been added.