Not mentioning much about the Nand2tetris course and uploading the assembly file which interacts with the keyboard.
Basically what this program does is when a key is pressed on the keyboard the screen turns black i.e. every pixel of the screen is supposed to turn black and when the keyboard is idle the screen stays white .
Here is my code and it works well on my computer's hardware simulator but fails when I upload it for submission on coursera.
@place
M=0
(LOOP)
@KBD
D=M
@WHITE
D; JEQ
@BLACK
0; JMP
(WHITE)
@place
D=M
@LOOP
D; JLT
@place
D=M
@SCREEN
A=A+D
M=0
@place
M=M-1
@LOOP
0;JMP
(BLACK)
@place
D=M
@LOOP
D; JGE
@SCREEN
A=A+D
M=-1
@place
M=M-1
@LOOP
0; JMP
Where am I getting wrong ? What is the reason for comparison failure and how can I sort it out ? Thanks in advance