summaryrefslogtreecommitdiff
path: root/projects
diff options
context:
space:
mode:
Diffstat (limited to 'projects')
-rw-r--r--projects/hack-vm/memory.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/projects/hack-vm/memory.py b/projects/hack-vm/memory.py
index ad22482..84f4a53 100644
--- a/projects/hack-vm/memory.py
+++ b/projects/hack-vm/memory.py
@@ -44,8 +44,7 @@ D=A
@{segment}
M=M+D
@SP
-M=M-1
-A=M
+AM=M-1
D=M
@{segment}
A=M
@@ -58,8 +57,7 @@ M=M-D
# when <segment> is one of static, temp and pointer
POP_FIXED_ASM = """@SP
-M=M-1
-A=M
+AM=M-1
D=M
@{addr}
M=D