Fill.asm passes automated test, but screen not filling black on Fill.tst

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fill.asm passes automated test, but screen not filling black on Fill.tst

sharonsw
This post was updated on .
Hello,

I have been stuck on Fill.asm for a while now, so I would appreciate any help on this matter!
To be more specific, I'm struggling to get the screen to fill up black when I press down on a key on my real keyboard.

Behaviour:
When I load my Fill.hack and run it against Fill.tst, I do as the instructions has told and set my View to Screen and select the "No Animation" option. When I hold down to a key, the screen shows one tiny black dot on the corner of the screen as I'm holding down the key, and disappears as soon as a keyup, instead of filling up the screen with all black as expected.

Suspecting that my program logic might be flawed, I select the "Program Flow" option and slow down the speed of execution to observe the actual values being set in the RAM window. The values being set appears to be what I expected:

Observed behaviour of the RAM during keypress:
1. RAM[24576] (@KBD) registers non-zero value
2. ROM jumps to (SETBLACK) line
3. Correct screen register is set to -1 at each loop (RAM[16384] = -1, RAM[16385] = -1, RAM[16386]= -1, etc.). The Screen shows a single black dot throughout, even though the data shows multiple registers in RAM are set to -1.
4. my current index variable @current is incremented by 1 at the end of each loop

Running my program against FillAutomatic.tst shows a "End of Script - Comparison ended successfully" message. When the test script is programmatically setting my keyboard input as 1 (non-zero value), apparently the output is determined to have been set to black, even though I don't see the screen blacken or anything.

Let me know if anyone has ideas on what might be causing this issue. I would also love a second pair of eyes to look over my program if possible!

Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm passes automated test, but screen not filling black on Fill.tst

cadet1620
Administrator
This same problem was observed a while ago with a bad version of Java.

See this forum post.

If this doesn't help, please post what OS and Java version you are using.
Reply | Threaded
Open this post in threaded view
|

Re: Fill.asm passes automated test, but screen not filling black on Fill.tst

sharonsw
Running the same program on a different laptop (java 1.8 installed) did it for me! Looks like the screen on the CPU emulator doesn't work with java version 1.6. 

Sent from my iPhone

On Aug 8, 2017, at 6:53 AM, cadet1620 [via Nand2Tetris Questions and Answers Forum] <[hidden email]> wrote:

This same problem was observed a while ago with a bad version of Java.

See this forum post.

If this doesn't help, please post what OS and Java version you are using.



To unsubscribe from Fill.asm passes automated test, but screen not filling black on Fill.tst, click here.
NAML