summaryrefslogtreecommitdiff
path: root/projects/hack-vm/__main__.py
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hack-vm/__main__.py')
-rw-r--r--projects/hack-vm/__main__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/projects/hack-vm/__main__.py b/projects/hack-vm/__main__.py
index bacbc94..5335583 100644
--- a/projects/hack-vm/__main__.py
+++ b/projects/hack-vm/__main__.py
@@ -1,6 +1,7 @@
import os
from pathlib import Path
from argparse import ArgumentParser
+from .vminit import vminit
from .memory import translate_memory
from .arith_logic import translate_arith_logic
from .compare import translate_compare
@@ -25,6 +26,7 @@ def vm_translate(input_path, verbose):
# assembly translated from all .vm files will be concatenated here
asm = ""
+ # asm = vminit(input_path.stem)
for input_fn in vm_files:
# load all vm commands from file, e.g. program/Main.vm
@@ -56,7 +58,7 @@ def vm_translate(input_path, verbose):
case [("lt" | "eq" | "gt") as command]:
asm += translate_compare(command, verbose)
case [("label" | "goto" | "if-goto") as action, label]:
- asm += translate_branching(action, label, verbose)
+ asm += translate_branching(action, label, prog, verbose)
case [("call" | "function") as action, function, n]:
asm += translate_function(action, function, n, prog, verbose)
case ["return"]: