So, I can turn any pixel black if a key is pressed. However, the screen is made up of 8192 memory locations starting at 16384, how can I go through and set all of those to -1 without having to write every memory location and setting M=-1... I was thinking I could increment the A registers location and loop through but I can't seem to come up with anything.
The A register in the Hack computer is a very busy register since it must be used for all memory accesses and to load all constants. It is not possible to keep addr in A and do the loop end address comparison. A also needs to be used when you add the keyboard check to the loop.
addr needs to be a variable in memory. It is accessed just like R0, R1 and R2 were in Mult.asm. (The Rn registers are really just memory variables with fixed addresses.)