From 040cf91851036a0216e7b5faea1f74ecd674db50 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 3 Jan 2018 11:49:20 +0100 Subject: Finished Project 7 --- .../07/MemoryAccess/PointerTest/PointerTest.asm | 138 +++++++++++++++++++++ .../07/MemoryAccess/PointerTest/PointerTest.out | 2 + 2 files changed, 140 insertions(+) create mode 100644 projects/07/MemoryAccess/PointerTest/PointerTest.asm create mode 100644 projects/07/MemoryAccess/PointerTest/PointerTest.out (limited to 'projects/07/MemoryAccess/PointerTest') diff --git a/projects/07/MemoryAccess/PointerTest/PointerTest.asm b/projects/07/MemoryAccess/PointerTest/PointerTest.asm new file mode 100644 index 0000000..67125df --- /dev/null +++ b/projects/07/MemoryAccess/PointerTest/PointerTest.asm @@ -0,0 +1,138 @@ +@256 +D=A +@SP +M=D +@3030 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@3 +M=D +@3040 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@SP +AM=M-1 +D=M +@4 +M=D +@32 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@THIS +D=M +@2 +D=A+D +@R13 +M=D +@SP +AM=M-1 +D=M +@R13 +A=M +M=D +@46 +D=A +@SP +A=M +M=D +@SP +M=M+1 +@THAT +D=M +@6 +D=A+D +@R13 +M=D +@SP +AM=M-1 +D=M +@R13 +A=M +M=D +@3 +D=M +@SP +A=M +M=D +@SP +M=M+1 +@4 +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 +@THIS +D=M +@2 +D=A+D +A=D +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 +@THAT +D=M +@6 +D=A+D +A=D +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 +(END) +@END +0;JMP \ No newline at end of file diff --git a/projects/07/MemoryAccess/PointerTest/PointerTest.out b/projects/07/MemoryAccess/PointerTest/PointerTest.out new file mode 100644 index 0000000..5d62de8 --- /dev/null +++ b/projects/07/MemoryAccess/PointerTest/PointerTest.out @@ -0,0 +1,2 @@ +|RAM[256]| RAM[3] | RAM[4] |RAM[3032|RAM[3046| +| 6084 | 3030 | 3040 | 32 | 46 | -- cgit v1.2.3