Beispiel #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)
Beispiel #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")
Beispiel #3
0
def Minus(type_):
    return getopbyte("isub")
Beispiel #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")
Beispiel #5
0
def Shright(type_):
    return getopbyte("ishr")
Beispiel #6
0
def Shleft(type_):
    return getopbyte("ishl")
Beispiel #7
0
def Plus_(type_):
    return getopbyte("iadd")
Beispiel #8
0
def Or_(type_):
    return getopbyte("ior")
Beispiel #9
0
def And_(type_):
    return getopbyte("iand")
Beispiel #10
0
def Xor(type_):
    return getopbyte("ixor")
Beispiel #11
0
def Intdiv(type_):
    return getopbyte("idiv")
Beispiel #12
0
def Truediv(type_):
    return getopbyte("fdiv")
Beispiel #13
0
def Times(type_):
    return getopbyte("imul")
Beispiel #14
0
 def writebytes(self):
     self.outputfile.write(getopbyte(self.op))