hello everyone. I would be grateful to all if you can tell me what should be modified in project 4, fill.asm file if i want the screen to be blak not pressing any key, but pressing a specific key from keyboard..it doesn t matter which one...
By default, if you press any key, screen become black, but i want to be black only when i press a specific key...
the cod is this>
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/04/Fill.asm
// Runs an infinite loop that listens to the keyboard input.
// When a key is pressed (any key), the program blackens the screen,
// i.e. writes "black" in every pixel;
// the screen should remain fully black as long as the key is pressed.
// When no key is pressed, the program clears the screen, i.e. writes
// "white" in every pixel;
// the screen should remain fully clear as long as no key is pressed.
// Put your code here.
// First, a simpler program the just fills the entire screen
//... this fills the screen with black but stops with err msg: Can't continue past last line
Examine your code and see why it becomes black when any key is pressed. How does the code know that a key is pressed? What would be different about that condition if, say, the 'B' key was pressed as opposed to the 'W' key?
This whole course is done in order for people to learn something valuable. If WBahn or somebody else just solves your problem what would you learn? I think very little.
Instead they are trying to guide you in the right direction without directly saying "this is the problem and this is how to fix it". Try to read the questions again and to actually answer them based on what your code does.
Whenever a key is pressed on the physical keyboard, its 16-bit ASCII code appears in
RAM. When no key is pressed, the code 0 appears in this location..but how to tell to the program that down arrow is pressed for example? where shoud i put its code 133 (down arrow code)..?