please help me modify this hack alu assembly code to display "CS 220" in the nand2tetris screen using the CPU Emulator, it is not working.. it only displays a small sliver of pixels at the top left corner // 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)
please help me modify this hack alu assembly code to display "CS 220" in the nand2tetris screen using the CPU Emulator, it is not working.. it only displays a small sliver of pixels at the top left corner // 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)
Step by step
Solved in 2 steps