bryan5 wrote
When I test the code in the CPUEmulator, the screen is always black.
@24576 // m = 24576
D=A
@m
M=D
So here you have set the variable 'm' to the value 24576
@m
D=M
@WHITE
D;JEQ
@BLACK
D;JGT
And here you jump to BLACK if the value stored in the variable 'm' is greater than zero.
It is doing EXACTLY what your pseudocode says:
(DECISION) // if (m = 0) goto WHITE
// if (m > 0) goto BLACK
So start by asking yourself why you want to jump to black if the value stored in the variable 'm' is greater than zero.