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)
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")
def Minus(type_): return getopbyte("isub")
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")
def Shright(type_): return getopbyte("ishr")
def Shleft(type_): return getopbyte("ishl")
def Plus_(type_): return getopbyte("iadd")
def Or_(type_): return getopbyte("ior")
def And_(type_): return getopbyte("iand")
def Xor(type_): return getopbyte("ixor")
def Intdiv(type_): return getopbyte("idiv")
def Truediv(type_): return getopbyte("fdiv")
def Times(type_): return getopbyte("imul")
def writebytes(self): self.outputfile.write(getopbyte(self.op))