summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Abed <michael@pidgey.localdomain>2012-01-29 18:51:59 -0500
committerMichael Abed <michael@pidgey.localdomain>2012-01-29 18:51:59 -0500
commit2cad8b8687133ba2c38767e58166d728b65731eb (patch)
tree5c60e86bb5b27e8766a3ba587c71b84c6e3125d6
parent015ea1f428c5b5da762124529363eaa3c642e21c (diff)
downloadec327-hw1-2cad8b8687133ba2c38767e58166d728b65731eb.tar.gz
ec327-hw1-2cad8b8687133ba2c38767e58166d728b65731eb.tar.bz2
ec327-hw1-2cad8b8687133ba2c38767e58166d728b65731eb.zip
Label count should be updated after address is computed
Otherwise you it points to the address right before it, not after
-rwxr-xr-xasmblr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/asmblr.py b/asmblr.py
index 9309040..e6a35e1 100755
--- a/asmblr.py
+++ b/asmblr.py
@@ -18,8 +18,8 @@ def genaddresses(tokens):
if ':' not in t[0]:
continue
label = t[0].split(':')[0]
- lblcnt += 1
table[label] = offset + i - lblcnt
+ lblcnt += 1
return table
def gencode(tokens, addresses, ops):