Please help me fix the following code, it is supposed to print (centered) 'CS 220' on the Nand2Tetris screen which uses the CPU Emulator and loaded ROM and RAM registers. The  code is not working its only printing a small sliver of pixels onto the top left of the screen.// Built-in constant in Assembly  // @SCREEN   // A=16384// D=A // Let's say we start at address 16640 (this is where our text will be placed)@16640D=A            // D = 16640 (starting address for text)@addressM=D           // store starting address in 'address' variable // Initialize count to 0 (start counting for 6 characters)@countM=0            // initialize the count to 0 (LOOP)@6D=A            // D = 6 (total number of characters to print)@countD=M-D          // D = count - 6@ENDLOOPD;JGE          // if count >= 6, jump to ENDLOOP // Place character 'C' (ASCII 67) at current address@67D=A            // D = 67 (ASCII value for 'C')@addressA=M            // A = current addressM=D            // Store 'C' at the current address // Move to the next memory location (increment by 1)@addressM=M+1          // Increment address by 1 // Place character 'S' (ASCII 83)@83D=A            // D = 83 (ASCII value for 'S')@addressA=M            // A = current addressM=D            // Store 'S' at the current address // Move to the next memory location@addressM=M+1          // Increment address by 1 // Place space character ' ' (ASCII 32)@32D=A            // D = 32 (ASCII value for space)@addressA=M            // A = current addressM=D            // Store space at the current address // Move to the next memory location@addressM=M+1          // Increment address by 1 // Place character '2' (ASCII 50)@50D=A            // D = 50 (ASCII value for '2')@addressA=M            // A = current addressM=D            // Store '2' at the current address // Move to the next memory location@addressM=M+1          // Increment address by 1 // Place another '2' (ASCII 50)@50D=A            // D = 50 (ASCII value for '2')@addressA=M            // A = current addressM=D            // Store '2' at the current address // Move to the next memory location@addressM=M+1          // Increment address by 1 // Place character '0' (ASCII 48)@48D=A            // D = 48 (ASCII value for '0')@addressA=M            // A = current addressM=D            // Store '0' at the current address // End of program, prevent further operations@END0;JMP (END)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Question

Please help me fix the following code, it is supposed to print (centered) 'CS 220' on the Nand2Tetris screen which uses the CPU Emulator and loaded ROM and RAM registers. The  code is not working its only printing a small sliver of pixels onto the top left of the screen.// Built-in constant in Assembly 

// @SCREEN   // A=16384
// D=A

// Let's say we start at address 16640 (this is where our text will be placed)
@16640
D=A            // D = 16640 (starting address for text)
@address
M=D           // store starting address in 'address' variable

// Initialize count to 0 (start counting for 6 characters)
@count
M=0            // initialize the count to 0

(LOOP)
@6
D=A            // D = 6 (total number of characters to print)
@count
D=M-D          // D = count - 6
@ENDLOOP
D;JGE          // if count >= 6, jump to ENDLOOP

// Place character 'C' (ASCII 67) at current address
@67
D=A            // D = 67 (ASCII value for 'C')
@address
A=M            // A = current address
M=D            // Store 'C' at the current address

// Move to the next memory location (increment by 1)
@address
M=M+1          // Increment address by 1

// Place character 'S' (ASCII 83)
@83
D=A            // D = 83 (ASCII value for 'S')
@address
A=M            // A = current address
M=D            // Store 'S' at the current address

// Move to the next memory location
@address
M=M+1          // Increment address by 1

// Place space character ' ' (ASCII 32)
@32
D=A            // D = 32 (ASCII value for space)
@address
A=M            // A = current address
M=D            // Store space at the current address

// Move to the next memory location
@address
M=M+1          // Increment address by 1

// Place character '2' (ASCII 50)
@50
D=A            // D = 50 (ASCII value for '2')
@address
A=M            // A = current address
M=D            // Store '2' at the current address

// Move to the next memory location
@address
M=M+1          // Increment address by 1

// Place another '2' (ASCII 50)
@50
D=A            // D = 50 (ASCII value for '2')
@address
A=M            // A = current address
M=D            // Store '2' at the current address

// Move to the next memory location
@address
M=M+1          // Increment address by 1

// Place character '0' (ASCII 48)
@48
D=A            // D = 48 (ASCII value for '0')
@address
A=M            // A = current address
M=D            // Store '0' at the current address

// End of program, prevent further operations
@END
0;JMP

(END)

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education