Exemplo n.º 1
0
 def generateSwitch(self):
   self.p('switch (i) {')
   for b in range(256):
     i = dt.lookupInstruction(b)
     if i is None:
       # print 'failed to lookup %s' % int2bin(b, 8)
       continue
     self.p('case 0x%s:  // %s %s' % (bintools.int2hex(b, 2), bintools.int2bin(b, 8), i.getDisasName()))
     self.indent()
     self.caseBody(i, b)
     self.outdent()
   self.p('}')
Exemplo n.º 2
0
 def setConditional(self, n):
   self.disas = re.sub(r'\$CCC', K.condNames[n], self.disas)
   self.p1 = bintools.int2bin(n, 3)