summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xasmblr.py3
-rw-r--r--test.asm3
2 files changed, 5 insertions, 1 deletions
diff --git a/asmblr.py b/asmblr.py
index ba2c89c..93dd097 100755
--- a/asmblr.py
+++ b/asmblr.py
@@ -4,7 +4,7 @@ import sys
def tokenize(i):
- if i[0] == ';': return None
+ if i[0] == ';' or i.strip() == '': return None
x = i.strip().split(' ')
if len(x) == 3 and ',' in x[1]:
x[1] = x[1].split(',')[0]
@@ -104,6 +104,7 @@ for i in prgm:
tokens = filter(None, tokens)
+
addresses = genaddresses(tokens)
code = gencode(tokens, addresses, opcodes)
diff --git a/test.asm b/test.asm
new file mode 100644
index 0000000..2db76c1
--- /dev/null
+++ b/test.asm
@@ -0,0 +1,3 @@
+mov R0, 0x32
+add R0, R0
+halt