From 0b1849231f9fbd5b6ab44dfb8c831a3893996dfb Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 5 Jan 2018 13:10:41 +0100 Subject: partially finished project 08 - finished flow bit (will need to change the labels to f$label) - finished simplefunction test --- .../SimpleFunction/SimpleFunction.asm | 137 +++++++++++++++++++++ .../SimpleFunction/SimpleFunction.out | 2 + 2 files changed, 139 insertions(+) create mode 100644 projects/08/FunctionCalls/SimpleFunction/SimpleFunction.asm create mode 100644 projects/08/FunctionCalls/SimpleFunction/SimpleFunction.out (limited to 'projects/08/FunctionCalls') diff --git a/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.asm b/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.asm new file mode 100644 index 0000000..7fe71a5 --- /dev/null +++ b/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.asm @@ -0,0 +1,137 @@ +(SimpleFunction.test) +@SP +A=M +M=0 +@SP +M=M+1 +@SP +A=M +M=0 +@SP +M=M+1 +@LCL +D=M +@0 +D=A+D +A=D +D=M +@SP +A=M +M=D +@SP +M=M+1 +@LCL +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 +@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 +@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 +@SP +AM=M-1 +D=M+D +@SP +A=M +M=D +@SP +M=M+1 +@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 +@SP +AM=M-1 +D=M-D +@SP +A=M +M=D +@SP +M=M+1 +@LCL +D=M +@R13 +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 +@R13 +A=M-1 +A=M +0;JMP +(END) +@END +0;JMP \ No newline at end of file diff --git a/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.out b/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.out new file mode 100644 index 0000000..ef72b7a --- /dev/null +++ b/projects/08/FunctionCalls/SimpleFunction/SimpleFunction.out @@ -0,0 +1,2 @@ +| RAM[0] | RAM[1] | RAM[2] | RAM[3] | RAM[4] |RAM[310]| +| 311 | 305 | 300 | 3010 | 4010 | 1196 | -- cgit v1.2.3