Nand2tetris Project4- Test failed – of Fill.asm: Comparison failure at line 3

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



Read more here: https://stackoverflow.com/questions/64398746/nand2tetris-project4-test-failed-of-fill-asm-comparison-failure-at-line-3

Content Attribution

This content was originally published by kirti purohit at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: