diff python/asm.py @ 159:5e1dd04cb61c

Added attempt to assembler
author Windel Bouwman
date Fri, 08 Mar 2013 17:16:22 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/python/asm.py	Fri Mar 08 17:16:22 2013 +0100
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+# Assembler
+
+import sys, argparse
+import pdb
+
+import libasm
+
+parser = argparse.ArgumentParser(description="Assembler")
+pdb.set_trace()
+parser.add_argument('sourcefile', type=argparse.FileType('r'), help='the source file to assemble')
+args = parser.parse_args()
+
+
+a = libasm.Assembler()
+obj = a.assemble(args.sourcefile.read())
+
+print('object:', obj)
+