summaryrefslogtreecommitdiff
path: root/projects/07/StackArithmetic/SimpleAdd
diff options
context:
space:
mode:
Diffstat (limited to 'projects/07/StackArithmetic/SimpleAdd')
-rw-r--r--projects/07/StackArithmetic/SimpleAdd/SimpleAdd.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/projects/07/StackArithmetic/SimpleAdd/SimpleAdd.asm b/projects/07/StackArithmetic/SimpleAdd/SimpleAdd.asm
new file mode 100644
index 0000000..71d9d8d
--- /dev/null
+++ b/projects/07/StackArithmetic/SimpleAdd/SimpleAdd.asm
@@ -0,0 +1,19 @@
+@7
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@8
+D=A
+@SP
+A=M
+M=D
+@SP
+M=M+1
+@SP
+AM=M-1
+D=M
+A=A-1
+M=D+M