diff options
Diffstat (limited to 'projects/08/FunctionCalls/StaticsTest')
-rw-r--r-- | projects/08/FunctionCalls/StaticsTest/StaticsTest.asm | 586 | ||||
-rw-r--r-- | projects/08/FunctionCalls/StaticsTest/StaticsTest.out | 2 |
2 files changed, 588 insertions, 0 deletions
diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm b/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm new file mode 100644 index 0000000..2d6f2aa --- /dev/null +++ b/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm @@ -0,0 +1,586 @@ +@256 +D=A +@SP +M=D +@RET0 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@SP +A=M +M=D +@SP +M=M+1 +@ARG +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +D=M +@LCL +M=D +@5 +D=D-A +@0 +D=D-A +@ARG +M=D +@Sys.init +0;JMP +(RET0) +(Class2.set) +@ARG +D=M +@0 +D=A+D +A=D +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@Class2.0 +M=D +@ARG +D=M +@1 +D=A+D +A=D +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@Class2.1 +M=D +@0 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@R13 +M=D +@5 +A=D-A +D=M +@R14 +M=D +@SP +AM=M-1 +D=M +@ARG +A=M +M=D +@ARG +D=M+1 +@SP +M=D +@R13 +AM=M-1 +D=M +@THAT +M=D +@R13 +AM=M-1 +D=M +@THIS +M=D +@R13 +AM=M-1 +D=M +@ARG +M=D +@R13 +AM=M-1 +D=M +@LCL +M=D +@R14 +A=M +0;JMP +(Class2.get) +@Class2.0 +D=M +@SP +A=M +M=D +@SP +M=M+1 +@Class2.1 +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@SP +AM=M-1 +D=M-D +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@R13 +M=D +@5 +A=D-A +D=M +@R14 +M=D +@SP +AM=M-1 +D=M +@ARG +A=M +M=D +@ARG +D=M+1 +@SP +M=D +@R13 +AM=M-1 +D=M +@THAT +M=D +@R13 +AM=M-1 +D=M +@THIS +M=D +@R13 +AM=M-1 +D=M +@ARG +M=D +@R13 +AM=M-1 +D=M +@LCL +M=D +@R14 +A=M +0;JMP +(Sys.init) +@6 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@8 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@RET3 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@SP +A=M +M=D +@SP +M=M+1 +@ARG +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +D=M +@LCL +M=D +@5 +D=D-A +@2 +D=D-A +@ARG +M=D +@Class1.set +0;JMP +(RET3) +@SP +AM=M-1 +D=M +@5 +M=D +@23 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@15 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@RET7 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@SP +A=M +M=D +@SP +M=M+1 +@ARG +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +D=M +@LCL +M=D +@5 +D=D-A +@2 +D=D-A +@ARG +M=D +@Class2.set +0;JMP +(RET7) +@SP +AM=M-1 +D=M +@5 +M=D +@RET9 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@SP +A=M +M=D +@SP +M=M+1 +@ARG +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +D=M +@LCL +M=D +@5 +D=D-A +@0 +D=D-A +@ARG +M=D +@Class1.get +0;JMP +(RET9) +@RET10 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@SP +A=M +M=D +@SP +M=M+1 +@ARG +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +D=M +@LCL +M=D +@5 +D=D-A +@0 +D=D-A +@ARG +M=D +@Class2.get +0;JMP +(RET10) +(Sys.init$WHILE) +@Sys.init$WHILE +0;JMP +(Class1.set) +@ARG +D=M +@0 +D=A+D +A=D +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@Class1.0 +M=D +@ARG +D=M +@1 +D=A+D +A=D +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@Class1.1 +M=D +@0 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@R13 +M=D +@5 +A=D-A +D=M +@R14 +M=D +@SP +AM=M-1 +D=M +@ARG +A=M +M=D +@ARG +D=M+1 +@SP +M=D +@R13 +AM=M-1 +D=M +@THAT +M=D +@R13 +AM=M-1 +D=M +@THIS +M=D +@R13 +AM=M-1 +D=M +@ARG +M=D +@R13 +AM=M-1 +D=M +@LCL +M=D +@R14 +A=M +0;JMP +(Class1.get) +@Class1.0 +D=M +@SP +A=M +M=D +@SP +M=M+1 +@Class1.1 +D=M +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@SP +AM=M-1 +D=M-D +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@R13 +M=D +@5 +A=D-A +D=M +@R14 +M=D +@SP +AM=M-1 +D=M +@ARG +A=M +M=D +@ARG +D=M+1 +@SP +M=D +@R13 +AM=M-1 +D=M +@THAT +M=D +@R13 +AM=M-1 +D=M +@THIS +M=D +@R13 +AM=M-1 +D=M +@ARG +M=D +@R13 +AM=M-1 +D=M +@LCL +M=D +@R14 +A=M +0;JMP diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTest.out b/projects/08/FunctionCalls/StaticsTest/StaticsTest.out new file mode 100644 index 0000000..309f058 --- /dev/null +++ b/projects/08/FunctionCalls/StaticsTest/StaticsTest.out @@ -0,0 +1,2 @@ +| RAM[0] |RAM[261]|RAM[262]| +| 263 | -2 | 8 | |