def to_x86(self): return ( make_x86("pushq", "%rDI") + "\n" + make_x86("subq", "$8", "%rSP") + "\n" + make_x86("movq", make_value(self.src), "%rDI") + "\n" + ((make_x86("addq", "$16", "%rDI") + "\n") if (self.src.name == "rSP") else "") + make_x86("callq", ("print" if platform_check.is_gcc() else "_print")) + "\n" + make_x86("addq", "$8", "%rSP") + "\n" + make_x86("popq", "%rDI") )
def to_x86(self): is_not_rax = self.dest.name != "rAX" this_str = "" if is_not_rax: this_str += make_x86("pushq", "%rAX") + "\n" this_str += make_x86("subq", "$8", "%rSP") + "\n" this_str += make_x86("callq", ("random" if platform_check.is_gcc() else "_random")) if is_not_rax: this_str += "\n" + make_x86("movq", "%rAX", make_value(self.dest)) this_str += "\n" + make_x86("addq", "$8", "%rSP") this_str += "\n" + make_x86("popq", "%rAX") return this_str