Re: Setting A in C-instruction
Posted by WBahn on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Setting-A-in-C-instruction-tp4036936p4036937.html
The CPU isn't going to try to write some superfluous value into the A-register. It will only attempt to change the contents of the A-register after the output of the ALU has had time to make it back to the A-register data input.
At the 'tick' event, the results from the machine state (registers, RAM, PC) are updated according to the PREVIOUS instruction. So unless the prior instruction wrote to the A-register, nothing will happen to it on the tick event. At the 'tock' event, all chip outputs are evaluated based on the machine state that was captured on the 'tick'. This is when the D input will be routed to the A-register input AND when the load signal on it will be asserted. Nothing further will happen until the following 'tick' event, at which time the A-register contents will be changed.