Example #1
0
 def writebytes(self):
     self.alignment = (self.outputfile.pos - self.wstartbyte + 1) % 4
     self.outputfile.write(getopbyte(self.op))
     if self.alignment != 0:
         self.outputfile.write(b'\x00' * (4 - self.alignment))
     for i in self.default, self.low, self.high:
         registeredclasses["u4"](self).writebytes(i)
     for i in self.switchtable:
         registeredclasses["u4"](self).writebytes(i)
Example #2
0
def Noteq(type_):
    return getopbyte("if_icmpne", (4).to_bytes(2, "big")) + \
           getopbyte("iconst_1") + \
           getopbyte("goto", (1).to_bytes(2, "big")) + \
           getopbyte("iconst_0")
Example #3
0
def Minus(type_):
    return getopbyte("isub")
Example #4
0
def Gthan(type_):
    return getopbyte("if_icmpgt", (4).to_bytes(2, "big")) + \
           getopbyte("iconst_1") + \
           getopbyte("goto", (1).to_bytes(2, "big")) + \
           getopbyte("iconst_0")
Example #5
0
def Shright(type_):
    return getopbyte("ishr")
Example #6
0
def Shleft(type_):
    return getopbyte("ishl")
Example #7
0
def Plus_(type_):
    return getopbyte("iadd")
Example #8
0
def Or_(type_):
    return getopbyte("ior")
Example #9
0
def And_(type_):
    return getopbyte("iand")
Example #10
0
def Xor(type_):
    return getopbyte("ixor")
Example #11
0
def Intdiv(type_):
    return getopbyte("idiv")
Example #12
0
def Truediv(type_):
    return getopbyte("fdiv")
Example #13
0
def Times(type_):
    return getopbyte("imul")
Example #14
0
 def writebytes(self):
     self.outputfile.write(getopbyte(self.op))