summaryrefslogtreecommitdiff
path: root/projects/07/MemoryAccess/PointerTest
diff options
context:
space:
mode:
Diffstat (limited to 'projects/07/MemoryAccess/PointerTest')
-rw-r--r--projects/07/MemoryAccess/PointerTest/PointerTest.asm125
1 files changed, 125 insertions, 0 deletions
diff --git a/projects/07/MemoryAccess/PointerTest/PointerTest.asm b/projects/07/MemoryAccess/PointerTest/PointerTest.asm
new file mode 100644
index 0000000..9511e12
--- /dev/null
+++ b/projects/07/MemoryAccess/PointerTest/PointerTest.asm
@@ -0,0 +1,125 @@
+@3030
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@SP
+M=M-1
+A=M
+D=M
+@THIS
+M=D
+@3040
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@SP
+M=M-1
+A=M
+D=M
+@THAT
+M=D
+@32
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@2
+D=A
+@THIS
+M=M+D
+@SP
+M=M-1
+A=M
+D=M
+@THIS
+A=M
+M=D
+@2
+D=A
+@THIS
+M=M-D
+@46
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@6
+D=A
+@THAT
+M=M+D
+@SP
+M=M-1
+A=M
+D=M
+@THAT
+A=M
+M=D
+@6
+D=A
+@THAT
+M=M-D
+@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
+M=M-1
+A=M
+D=M
+@SP
+A=M-1
+M=D+M
+@THIS
+D=M
+@2
+A=D+A
+D=M
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@SP
+M=M-1
+A=M
+D=M
+@SP
+A=M-1
+M=M-D
+@THAT
+D=M
+@6
+A=D+A
+D=M
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@SP
+M=M-1
+A=M
+D=M
+@SP
+A=M-1
+M=D+M