aboutsummaryrefslogtreecommitdiffstats
path: root/atk16_asm/assembler.py
diff options
context:
space:
mode:
Diffstat (limited to 'atk16_asm/assembler.py')
-rwxr-xr-xatk16_asm/assembler.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/atk16_asm/assembler.py b/atk16_asm/assembler.py
index cbd7cd4..7142303 100755
--- a/atk16_asm/assembler.py
+++ b/atk16_asm/assembler.py
@@ -2,6 +2,7 @@
# Assemble ATK16 assembly to bytecode
import sys
+import os
from .asm_ops import *
from .asm_eval import *
from .asm_pass0 import pass_0
@@ -108,6 +109,9 @@ def main():
result = assemble(src, options.infile)
+ out_dirname = os.path.dirname(options.outfile)
+ os.makedirs(out_dirname, exist_ok=True)
+
with open(options.outfile, "wb") as f:
f.write(result.program)