Skip to content

Commit

Permalink
Fix mix case labels
Browse files Browse the repository at this point in the history
  • Loading branch information
asterick committed May 11, 2012
1 parent 9795607 commit d2e8cdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions coas.py
Expand Up @@ -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] == '_':
Expand Down Expand Up @@ -846,15 +846,15 @@ 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 """
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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion samples/helloworld.asm
Expand Up @@ -39,7 +39,7 @@ _loop: SUB I, 1
SET A, 0
SET B, screen
HWI I
JMP _loop
SET PC, POP
.endproc

; === DATA SECTION
Expand Down

0 comments on commit d2e8cdc

Please sign in to comment.