micro_asm.py (5009:78d53ea88c74) | micro_asm.py (5039:a9367ed7ca7b) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 41 unchanged lines hidden (view full) --- 50class Micro_Container(object): 51 def __init__(self, name): 52 self.microops = [] 53 self.name = name 54 self.directives = {} 55 self.micro_classes = {} 56 self.labels = {} 57 | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 41 unchanged lines hidden (view full) --- 50class Micro_Container(object): 51 def __init__(self, name): 52 self.microops = [] 53 self.name = name 54 self.directives = {} 55 self.micro_classes = {} 56 self.labels = {} 57 |
58 def add_microop(self, microop): | 58 def add_microop(self, mnemonic, microop): |
59 self.microops.append(microop) 60 61 def __str__(self): 62 string = "%s:\n" % self.name 63 for microop in self.microops: 64 string += " %s\n" % microop 65 return string 66 --- 71 unchanged lines hidden (view full) --- 138 print_error("Error creating microop object with mnemonic %s." % \ 139 statement.mnemonic) 140 raise 141 try: 142 for label in statement.labels: 143 container.labels[label.text] = microop 144 if label.extern: 145 container.externs[label.text] = microop | 59 self.microops.append(microop) 60 61 def __str__(self): 62 string = "%s:\n" % self.name 63 for microop in self.microops: 64 string += " %s\n" % microop 65 return string 66 --- 71 unchanged lines hidden (view full) --- 138 print_error("Error creating microop object with mnemonic %s." % \ 139 statement.mnemonic) 140 raise 141 try: 142 for label in statement.labels: 143 container.labels[label.text] = microop 144 if label.extern: 145 container.externs[label.text] = microop |
146 container.add_microop(microop) | 146 container.add_microop(statement.mnemonic, microop) |
147 except: 148 print_error("Error adding microop.") 149 raise 150 elif statement.is_directive: 151 if statement.name not in container.directives.keys(): 152 raise Exception, "Unrecognized directive: %s" % statement.name 153 parser.symbols["__directiveFunctionFromInsideTheAssembler"] = \ 154 container.directives[statement.name] --- 347 unchanged lines hidden --- | 147 except: 148 print_error("Error adding microop.") 149 raise 150 elif statement.is_directive: 151 if statement.name not in container.directives.keys(): 152 raise Exception, "Unrecognized directive: %s" % statement.name 153 parser.symbols["__directiveFunctionFromInsideTheAssembler"] = \ 154 container.directives[statement.name] --- 347 unchanged lines hidden --- |