Skip to content

Commit ffdea63

Browse files
committed
09 Println
1 parent b111536 commit ffdea63

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

09/Println/Main.jack

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Main {
2+
function void main() {
3+
do Output.printString("hello");
4+
return;
5+
}
6+
}

09/Println/Main.vm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function Main.main 0
2+
push constant 5
3+
call String.new 1
4+
push constant 104
5+
call String.appendChar 2
6+
push constant 101
7+
call String.appendChar 2
8+
push constant 108
9+
call String.appendChar 2
10+
push constant 108
11+
call String.appendChar 2
12+
push constant 111
13+
call String.appendChar 2
14+
call Output.printString 1
15+
pop temp 0
16+
push constant 0
17+
return

0 commit comments

Comments
 (0)