added v2.0
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../Array.jack
|
||||
@@ -0,0 +1 @@
|
||||
../GPIO.jack
|
||||
@@ -0,0 +1,49 @@
|
||||
// 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/12/OutputTest/Main.jack
|
||||
|
||||
/** Test program for the OS Output class. */
|
||||
class Main {
|
||||
|
||||
/** Outputs the entire character set to the screen using all the
|
||||
* methods of the Output class. */
|
||||
function void main() {
|
||||
var String s;
|
||||
|
||||
let s = String.new(1);
|
||||
do s.appendChar(String.doubleQuote());
|
||||
|
||||
do Output.moveCursor(0, 29);
|
||||
do Output.printChar(66);
|
||||
do Output.moveCursor(28, 0);
|
||||
do Output.printChar(67);
|
||||
do Output.moveCursor(28, 29);
|
||||
do Output.printChar(68);
|
||||
do Output.printChar(65);
|
||||
|
||||
do Output.moveCursor(2, 0);
|
||||
do Output.printString("0123456789");
|
||||
do Output.println();
|
||||
|
||||
do Output.printString("ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz");
|
||||
do Output.println();
|
||||
|
||||
do Output.printString("!#$%&'()*+,-./:;<=>?@[\]^_`{|}~");
|
||||
do Output.printString(s);
|
||||
do Output.println();
|
||||
|
||||
do Output.printInt(-12345);
|
||||
do Output.backSpace();
|
||||
do Output.printInt(6789);
|
||||
|
||||
do Screen.setPenColor(Screen.WHITE());
|
||||
do Screen.setBackColor(Screen.RED());
|
||||
|
||||
do Output.moveCursor(10, 0);
|
||||
do Output.printString("Back Color Red");
|
||||
do Output.println();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
all: jack vm asm bin sim
|
||||
|
||||
jack:
|
||||
../../tools/JackCompiler/JackCompiler.pyc ./
|
||||
vm:
|
||||
../../tools/VMTranslator/VMTranslator.pyc ./
|
||||
asm:
|
||||
../../tools/Assembler/assembler.pyc out.asm
|
||||
bin:
|
||||
../../tools/AsciiToBin.py out.hack
|
||||
sim:
|
||||
cp out.hack ../00_HACK/ROM.hack
|
||||
upload:
|
||||
iceprogduino -o 64k -w out.bin
|
||||
clean:
|
||||
rm -f *.vm *.asm *.hack *.bin *~
|
||||
|
||||
.PHONY: all clean
|
||||
@@ -0,0 +1 @@
|
||||
../Math.jack
|
||||
@@ -0,0 +1 @@
|
||||
../Memory.jack
|
||||
@@ -0,0 +1 @@
|
||||
../Output.jack
|
||||
@@ -0,0 +1,20 @@
|
||||
## Output.jack
|
||||
|
||||
A library of functions for writing text on the screen.
|
||||
The Hack physical screen consists of 320 rows of 240 pixels each. The library uses a fixed font, in which each character is displayed within a frame which is 11 pixels high (including 1 pixel for inter-line spacing) and 8 pixels wide (including 2 pixels for inter-character spacing). The resulting grid accommodates 29 rows (indexed 0..28, top to bottom) of 30 characters each (indexed 0..29, left to right). The top left character position on the screen is indexed (0,0). A cursor, implemented as a small filled square, indicates where the next character will be displayed.
|
||||
|
||||
***
|
||||
|
||||
### Project
|
||||
|
||||
* implement `Output.jack`
|
||||
* test in real hardware
|
||||
|
||||
```
|
||||
$ cd 09_Output_Test
|
||||
$ make
|
||||
$ make upload
|
||||
```
|
||||
|
||||
* compare your screen with:
|
||||

|
||||
@@ -0,0 +1,15 @@
|
||||
## Output.jack
|
||||
A library of functions for writing text on the screen.
|
||||
The Hack physical screen consists of 320 rows of 240 pixels each. The library uses a fixed font, in which each character is displayed within a frame which is 11 pixels high (including 1 pixel for inter-line spacing) and 8 pixels wide (including 2 pixels for inter-character spacing). The resulting grid accommodates 29 rows (indexed 0..28, top to bottom) of 30 characters each (indexed 0..29, left to right). The top left character position on the screen is indexed (0,0). A cursor, implemented as a small filled square, indicates where the next character will be displayed.
|
||||
***
|
||||
### Project
|
||||
* implement `Output.jack`
|
||||
* test in real hardware
|
||||
|
||||
```
|
||||
$ cd 09_Output_Test
|
||||
$ make
|
||||
$ make update
|
||||
```
|
||||
* compare your screen with:
|
||||

|
||||
@@ -0,0 +1 @@
|
||||
../Screen.jack
|
||||
@@ -0,0 +1 @@
|
||||
../StdIO.jack
|
||||
@@ -0,0 +1 @@
|
||||
../String.jack
|
||||
@@ -0,0 +1 @@
|
||||
../Sys.jack
|
||||
@@ -0,0 +1 @@
|
||||
../UART.jack
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
Reference in New Issue
Block a user