From d3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 20 Jan 2018 15:41:49 +0100 Subject: rearranged the dir for github - removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes --- projects/08/FunctionCalls/StaticsTest/Class1.vm | 20 - projects/08/FunctionCalls/StaticsTest/Class2.vm | 20 - .../08/FunctionCalls/StaticsTest/StaticsTest.asm | 586 --------------------- .../08/FunctionCalls/StaticsTest/StaticsTest.cmp | 2 - .../08/FunctionCalls/StaticsTest/StaticsTest.out | 2 - .../08/FunctionCalls/StaticsTest/StaticsTest.tst | 17 - .../FunctionCalls/StaticsTest/StaticsTestVME.tst | 17 - projects/08/FunctionCalls/StaticsTest/Sys.vm | 20 - 8 files changed, 684 deletions(-) delete mode 100644 projects/08/FunctionCalls/StaticsTest/Class1.vm delete mode 100644 projects/08/FunctionCalls/StaticsTest/Class2.vm delete mode 100644 projects/08/FunctionCalls/StaticsTest/StaticsTest.asm delete mode 100644 projects/08/FunctionCalls/StaticsTest/StaticsTest.cmp delete mode 100644 projects/08/FunctionCalls/StaticsTest/StaticsTest.out delete mode 100644 projects/08/FunctionCalls/StaticsTest/StaticsTest.tst delete mode 100644 projects/08/FunctionCalls/StaticsTest/StaticsTestVME.tst delete mode 100644 projects/08/FunctionCalls/StaticsTest/Sys.vm (limited to 'projects/08/FunctionCalls/StaticsTest') diff --git a/projects/08/FunctionCalls/StaticsTest/Class1.vm b/projects/08/FunctionCalls/StaticsTest/Class1.vm deleted file mode 100644 index c463537..0000000 --- a/projects/08/FunctionCalls/StaticsTest/Class1.vm +++ /dev/null @@ -1,20 +0,0 @@ -// 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/08/FunctionCalls/StaticsTest/Class1.vm - -// Stores two supplied arguments in static[0] and static[1]. -function Class1.set 0 -push argument 0 -pop static 0 -push argument 1 -pop static 1 -push constant 0 -return - -// Returns static[0] - static[1]. -function Class1.get 0 -push static 0 -push static 1 -sub -return diff --git a/projects/08/FunctionCalls/StaticsTest/Class2.vm b/projects/08/FunctionCalls/StaticsTest/Class2.vm deleted file mode 100644 index 94f2946..0000000 --- a/projects/08/FunctionCalls/StaticsTest/Class2.vm +++ /dev/null @@ -1,20 +0,0 @@ -// 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/08/FunctionCalls/StaticsTest/Class2.vm - -// Stores two supplied arguments in static[0] and static[1]. -function Class2.set 0 -push argument 0 -pop static 0 -push argument 1 -pop static 1 -push constant 0 -return - -// Returns static[0] - static[1]. -function Class2.get 0 -push static 0 -push static 1 -sub -return diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm b/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm deleted file mode 100644 index 2d6f2aa..0000000 --- a/projects/08/FunctionCalls/StaticsTest/StaticsTest.asm +++ /dev/null @@ -1,586 +0,0 @@ -@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.cmp b/projects/08/FunctionCalls/StaticsTest/StaticsTest.cmp deleted file mode 100644 index 5589f1e..0000000 --- a/projects/08/FunctionCalls/StaticsTest/StaticsTest.cmp +++ /dev/null @@ -1,2 +0,0 @@ -| RAM[0] |RAM[261]|RAM[262]| -| 263 | -2 | 8 | diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTest.out b/projects/08/FunctionCalls/StaticsTest/StaticsTest.out deleted file mode 100644 index 309f058..0000000 --- a/projects/08/FunctionCalls/StaticsTest/StaticsTest.out +++ /dev/null @@ -1,2 +0,0 @@ -| RAM[0] |RAM[261]|RAM[262]| -| 263 | -2 | 8 | diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTest.tst b/projects/08/FunctionCalls/StaticsTest/StaticsTest.tst deleted file mode 100644 index 1b9194e..0000000 --- a/projects/08/FunctionCalls/StaticsTest/StaticsTest.tst +++ /dev/null @@ -1,17 +0,0 @@ -// 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/08/FunctionCalls/StaticsTest/StaticsTest.tst - -load StaticsTest.asm, -output-file StaticsTest.out, -compare-to StaticsTest.cmp, -output-list RAM[0]%D1.6.1 RAM[261]%D1.6.1 RAM[262]%D1.6.1; - -set RAM[0] 256, - -repeat 2500 { - ticktock; -} - -output; diff --git a/projects/08/FunctionCalls/StaticsTest/StaticsTestVME.tst b/projects/08/FunctionCalls/StaticsTest/StaticsTestVME.tst deleted file mode 100644 index 130ba66..0000000 --- a/projects/08/FunctionCalls/StaticsTest/StaticsTestVME.tst +++ /dev/null @@ -1,17 +0,0 @@ -// 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/08/FunctionCalls/StaticsTest/StaticsTestVME.tst - -load, // loads all the VM files from the current directory. -output-file StaticsTest.out, -compare-to StaticsTest.cmp, -output-list RAM[0]%D1.6.1 RAM[261]%D1.6.1 RAM[262]%D1.6.1; - -set sp 261, - -repeat 36 { - vmstep; -} - -output; diff --git a/projects/08/FunctionCalls/StaticsTest/Sys.vm b/projects/08/FunctionCalls/StaticsTest/Sys.vm deleted file mode 100644 index 3708322..0000000 --- a/projects/08/FunctionCalls/StaticsTest/Sys.vm +++ /dev/null @@ -1,20 +0,0 @@ -// 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/08/FunctionCalls/StaticsTest/Sys.vm - -// Tests that different functions, stored in two different -// class files, manipulate the static segment correctly. -function Sys.init 0 -push constant 6 -push constant 8 -call Class1.set 2 -pop temp 0 // Dumps the return value -push constant 23 -push constant 15 -call Class2.set 2 -pop temp 0 // Dumps the return value -call Class1.get 0 -call Class2.get 0 -label WHILE -goto WHILE -- cgit v1.2.3