summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2011-12-04 14:44:00 +0000
committerPeter Wu <lekensteyn@gmail.com>2011-12-04 14:44:00 +0000
commit94fecea73b0185ff37eb47502f07a8f1e69cd3f9 (patch)
tree1395e029c06fcb4071fe7bcef5a035504aa716a8
parent61a73ce50b1c779879bffcd8235e9a529f3b1949 (diff)
downloadpp2cc-94fecea73b0185ff37eb47502f07a8f1e69cd3f9.tar.gz
Slightly better formatting of parsed asm
-rw-r--r--AsmLine.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/AsmLine.py b/AsmLine.py
index 0b99119..fc54cbe 100644
--- a/AsmLine.py
+++ b/AsmLine.py
@@ -106,13 +106,10 @@ class AsmLine(object):
return self.id_dict[name]
def __str__(self):
"""Returns a line of assembly"""
- line = ""
- if self.label:
- line += str(self.label) + ": "
- line += self.instruction
+ line = self.instruction.ljust(4)
if self.register:
line += " " + self.register
if self.operand:
# join all operand parts together
line += " " + "".join(str(elm) for elm in self.operand)
- return line
+ return self.asm.format_line(line, self.label)