Ich scheitere daran den Screen zu füllen

This commit is contained in:
Sven Riwoldt
2023-03-27 20:32:56 +02:00
parent c756d775e4
commit f91fc53c91
4 changed files with 139 additions and 2 deletions

View File

@@ -11,4 +11,45 @@
// "white" in every pixel;
// the screen should remain fully clear as long as no key is pressed.
// Put your code here.
// Put your code here.
(LOOP) // Abfrage des KBD-Speichers
@KBD //Adresse Keyboardspeicher
D=M //Datenregister = Speicheradresse
@KPRESSED
D;JGT
@NOKPRESSED
0;JMP
(KPRESSED) // Taste wurde/wird gedrückt
@R0
M=-1 // 11111111111111111 --> black Pixel
@ONSCREEN
0;JMP
(NOKPRESSED) // keine Taste gedrückt
@R0
M=0 // wieder auf 0 gesetzt
@ONSCREEN
0;JMP
(ONSCREEN)
// erste Zeile von 16384 bis 16415 => 32
// 31 * 256
// letztes Byte --> 8192 --> 16384 + 8192 =
@8191
D=A
@R1
M=D
//https://github.com/Olical/nand2tetris/blob/master/asm/fill/Fill.asm
(WEITER)
@R1
D=M
@WEITER
M=D
@LOOP
0;JMP