From d2e8cdc3e03f4be421bc15d6d7ef791056e02a1a Mon Sep 17 00:00:00 2001 From: Bryon Vandiver Date: Fri, 11 May 2012 09:49:27 -0700 Subject: [PATCH] Fix mix case labels --- coas.py | 8 ++++---- samples/helloworld.asm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/coas.py b/coas.py index dc5f7c6..47103d2 100644 --- a/coas.py +++ b/coas.py @@ -91,7 +91,7 @@ def __str__(self): class AssemblerLabel: def __init__(self, pos, name): self.pos = pos - self.name = name + self.name = name.lower() def setGroup(self, group): if self.name[0] == '_': @@ -846,7 +846,7 @@ def label(self, tokens, words, discovered = []): """ Attempt to stuff words into their respective areas """ def refold(self, tokens, words): - for t in [t for t in tokens]: + for t in list(tokens): yield self.equate(t, words) """ Convert complete instructions into binaries """ @@ -854,7 +854,7 @@ def getField(self, exp, allowLiteral=True, flatten=False, **kwargs): if isinstance(exp, AssemblerRegister): return self.REG_FIELD[exp.register], None elif isinstance(exp, AssemblerIndirect): - if isinstance(exp.term, AssemblerBinary) and exp.term.operation == '+' and isinstance(a, AssemblerRegister): + if isinstance(exp.term, AssemblerBinary) and exp.term.operation == '+' and isinstance(exp.term.term_a, AssemblerRegister): op, a, b = exp.term.operation, exp.term.term_a, exp.term.term_b # This can always be flatted, we do not provide a short literal @@ -972,7 +972,7 @@ def data(self, tokens, words): if isinstance(o, AssemblerNumber): yield o.number & 0xFFFF else: - raise AssemblerException(b.pos, "Could not evaluate to a number") + raise AssemblerException(b.pos, "Could not evaluate to a number: %s" % b ) else: yield b yield AssemblerAnnotation(t.pos) diff --git a/samples/helloworld.asm b/samples/helloworld.asm index aa9d155..81923af 100644 --- a/samples/helloworld.asm +++ b/samples/helloworld.asm @@ -39,7 +39,7 @@ _loop: SUB I, 1 SET A, 0 SET B, screen HWI I - JMP _loop + SET PC, POP .endproc ; === DATA SECTION