aboutsummaryrefslogtreecommitdiff
path: root/projects/07/StackArithmetic/StackTest
diff options
context:
space:
mode:
Diffstat (limited to 'projects/07/StackArithmetic/StackTest')
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTest.asm426
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTest.cmp4
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTest.out4
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTest.tst22
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTest.vm45
-rw-r--r--projects/07/StackArithmetic/StackTest/StackTestVME.tst22
6 files changed, 0 insertions, 523 deletions
diff --git a/projects/07/StackArithmetic/StackTest/StackTest.asm b/projects/07/StackArithmetic/StackTest/StackTest.asm
deleted file mode 100644
index 560ec6c..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTest.asm
+++ /dev/null
@@ -1,426 +0,0 @@
-@256
-D=A
-@SP
-M=D
-@17
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@17
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@SP
-AM=M-1
-D=M
-@SP
-AM=M-1
-D=M-D
-@EQ2
-D;JEQ
-@SP
-A=M
-M=0
-@SP
-M=M+1
-@ENDIFEQ2
-0;JMP
-(EQ2)
-@SP
-A=M
-M=-1
-@SP
-M=M+1
-(ENDIFEQ2)
-@17
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@16
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@SP
-AM=M-1
-D=M
-@SP
-AM=M-1
-D=M-D
-@EQ5
-D;JEQ
-@SP
-A=M
-M=0
-@SP
-M=M+1
-@ENDIFEQ5
-0;JMP
-(EQ5)
-@SP
-A=M
-M=-1
-@SP
-M=M+1
-(ENDIFEQ5)
-@16
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@17
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@SP
-AM=M-1
-D=M
-@SP
-AM=M-1
-D=M-D
-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A=M
-M=D
-@SP
-M=M+1
-@SP
-AM=M-1
-D=M
-@SP
-AM=M-1
-D=M-D
-@GT23
-D;JGT
-@SP
-A=M
-M=0
-@SP
-M=M+1
-@ENDIFGT23
-0;JMP
-(GT23)
-@SP
-A=M
-M=-1
-@SP
-M=M+1
-(ENDIFGT23)
-@32766
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@32766
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@SP
-AM=M-1
-D=M
-@SP
-AM=M-1
-D=M-D
-@GT26
-D;JGT
-@SP
-A=M
-M=0
-@SP
-M=M+1
-@ENDIFGT26
-0;JMP
-(GT26)
-@SP
-A=M
-M=-1
-@SP
-M=M+1
-(ENDIFGT26)
-@57
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@31
-D=A
-@SP
-A=M
-M=D
-@SP
-M=M+1
-@53
-D=A
-@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
-@112
-D=A
-@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
-@SP
-AM=M-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
-@82
-D=A
-@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
-@SP
-AM=M-1
-D=M
-@SP
-A=M
-M=!D
-@SP
-M=M+1
-(END)
-@END
-0;JMP \ No newline at end of file
diff --git a/projects/07/StackArithmetic/StackTest/StackTest.cmp b/projects/07/StackArithmetic/StackTest/StackTest.cmp
deleted file mode 100644
index f90fa1b..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTest.cmp
+++ /dev/null
@@ -1,4 +0,0 @@
-| RAM[0] | RAM[256] | RAM[257] | RAM[258] | RAM[259] | RAM[260] |
-| 266 | -1 | 0 | 0 | 0 | -1 |
-| RAM[261] | RAM[262] | RAM[263] | RAM[264] | RAM[265] |
-| 0 | -1 | 0 | 0 | -91 |
diff --git a/projects/07/StackArithmetic/StackTest/StackTest.out b/projects/07/StackArithmetic/StackTest/StackTest.out
deleted file mode 100644
index cb182ec..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTest.out
+++ /dev/null
@@ -1,4 +0,0 @@
-| RAM[0] | RAM[256] | RAM[257] | RAM[258] | RAM[259] | RAM[260] |
-| 266 | -1 | 0 | 0 | 0 | -1 |
-| RAM[261] | RAM[262] | RAM[263] | RAM[264] | RAM[265] |
-| 0 | -1 | 0 | 0 | -91 |
diff --git a/projects/07/StackArithmetic/StackTest/StackTest.tst b/projects/07/StackArithmetic/StackTest/StackTest.tst
deleted file mode 100644
index f9c5396..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTest.tst
+++ /dev/null
@@ -1,22 +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/07/StackArithmetic/StackTest/StackTest.tst
-
-load StackTest.asm,
-output-file StackTest.out,
-compare-to StackTest.cmp,
-output-list RAM[0]%D2.6.2
- RAM[256]%D2.6.2 RAM[257]%D2.6.2 RAM[258]%D2.6.2 RAM[259]%D2.6.2 RAM[260]%D2.6.2;
-
-set RAM[0] 256, // initializes the stack pointer
-
-repeat 1000 { // enough cycles to complete the execution
- ticktock;
-}
-
-// outputs the stack pointer (RAM[0]) and
-// the stack contents: RAM[256]-RAM[265]
-output;
-output-list RAM[261]%D2.6.2 RAM[262]%D2.6.2 RAM[263]%D2.6.2 RAM[264]%D2.6.2 RAM[265]%D2.6.2;
-output;
diff --git a/projects/07/StackArithmetic/StackTest/StackTest.vm b/projects/07/StackArithmetic/StackTest/StackTest.vm
deleted file mode 100644
index bfe78e0..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTest.vm
+++ /dev/null
@@ -1,45 +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/07/StackArithmetic/StackTest/StackTest.vm
-
-// Executes a sequence of arithmetic and logical operations
-// on the stack.
-push constant 17
-push constant 17
-eq
-push constant 17
-push constant 16
-eq
-push constant 16
-push constant 17
-eq
-push constant 892
-push constant 891
-lt
-push constant 891
-push constant 892
-lt
-push constant 891
-push constant 891
-lt
-push constant 32767
-push constant 32766
-gt
-push constant 32766
-push constant 32767
-gt
-push constant 32766
-push constant 32766
-gt
-push constant 57
-push constant 31
-push constant 53
-add
-push constant 112
-sub
-neg
-and
-push constant 82
-or
-not
diff --git a/projects/07/StackArithmetic/StackTest/StackTestVME.tst b/projects/07/StackArithmetic/StackTest/StackTestVME.tst
deleted file mode 100644
index b66bd05..0000000
--- a/projects/07/StackArithmetic/StackTest/StackTestVME.tst
+++ /dev/null
@@ -1,22 +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/07/StackArithmetic/StackTest/StackTestVME.tst
-
-load StackTest.vm,
-output-file StackTest.out,
-compare-to StackTest.cmp,
-output-list RAM[0]%D2.6.2
- RAM[256]%D2.6.2 RAM[257]%D2.6.2 RAM[258]%D2.6.2 RAM[259]%D2.6.2 RAM[260]%D2.6.2;
-
-set RAM[0] 256, // initializes the stack pointer
-
-repeat 38 { // StackTest.vm consists of 38 instructions
- vmstep;
-}
-
-// outputs the stack pointer (RAM[0]) and
-// the stack contents: RAM[256]-RAM[265]
-output;
-output-list RAM[261]%D2.6.2 RAM[262]%D2.6.2 RAM[263]%D2.6.2 RAM[264]%D2.6.2 RAM[265]%D2.6.2;
-output;