Exemplo n.º 1
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     v2 = stack.PopDouble()
     v1 = statk.PopDouble()
     result = v1 + v2
     stack.PushDouble(result)
Exemplo n.º 2
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     f = stack.PopFloat()
     l = struct.unpack('>q', struct.pack('>f', f))[0]
     stack.pushDoulbe(l)
Exemplo n.º 3
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     i = stack.PopInt()
     d = struct.unpack('>d', struct.pack('>i', i))[0]
     stack.pushInt(d)
Exemplo n.º 4
0
 def Execute(self, frame: rtda.Frame):
     thread = frame.Thread()
     currentFrame = thread.PopFrame()
     invokerFrame = thread.TopFrame()
     ref = currentFrame.OperandStack().PopRef()
     invokerFrame.OperandStack().PushRef(ref)
Exemplo n.º 5
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     l = stack.PopLong()
     i = struct.unpack('>i', struct.pack('>q', l))[0]
     stack.pushInt(i)
Exemplo n.º 6
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     slot1 = stack.PopSlot()
     slot2 = stack.PopSlot()
     stack.PushSlot(slot1)
     stack.PushSlot(slot2)
Exemplo n.º 7
0
 def Execute(self, frame:rtda.Frame):
     ref = frame.OperandStack().PopRef()
     if ref != None:
         base.Branch(frame, self.Offset)
Exemplo n.º 8
0
 def Execute(self, frame: rtda.Frame):
     frame.OperandStack().PushLong(1)
Exemplo n.º 9
0
 def Execute(self, frame: rtda.Frame):
     i = int(self.val)
     frame.OperandStack().PushInt(i)
Exemplo n.º 10
0
 def Execute(self, frame: rtda.Frame):
     frame.OperandStack().PushFloat(2.0)
Exemplo n.º 11
0
 def Execute(self, frame: rtda.Frame):
     frame.OperandStack().PushInt(-1)
Exemplo n.º 12
0
 def Execute(self, frame: rtda.Frame):
     frame.OperandStack().PushDouble(1.0)
Exemplo n.º 13
0
 def Execute(self, frame: rtda.Frame):
     frame.OperandStack().PushRef(None)
Exemplo n.º 14
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     v2 = stack.PopFloat()
     v1 = statk.PopFloat()
     result = v1 / v2
     stack.PushFloat(result)
Exemplo n.º 15
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     slot = stack.PopSlot()
     stack.PushSlot(slot)
     stack.PushSlot(copy.deepcopy(slot))
Exemplo n.º 16
0
def Branch(frame: rtda.Frame, offset: int):
    pc = frame.Thread().PC()
    nextPC = pc + offset
    frame.SetNextPC(nextPC)
Exemplo n.º 17
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     stack.PopSlot()
Exemplo n.º 18
0
def _lload(frame: rtda.Frame, index):
    val = frame.LocalVars().GetLong(index)
    frame.OperandStack().PushLong(val)
Exemplo n.º 19
0
def logInstruction(frame: rtda.Frame, inst: instructions.base.Instruction):
    method = frame.Method()
    className = method.Class().Name()
    methodName = method.Name()
    pc = frame.Thread().PC()
    print(f"{className}.{methodName} #{pc} {inst} {inst}")
Exemplo n.º 20
0
def _dload(frame: rtda.Frame, index):
    val = frame.LocalVars().GetDouble(index)
    frame.OperandStack().PushDouble(val)
Exemplo n.º 21
0
 def Execute(self, frame: rtda.Frame):
     frame.Thread().PopFrame()
Exemplo n.º 22
0
def _aload(frame: rtda.Frame, index):
    ref = frame.LocalVars().GetRef(index)
    frame.OperandStack().PushRef(ref)
Exemplo n.º 23
0
 def Execute(self, frame: rtda.Frame):
     thread = frame.Thread()
     currentFrame = thread.PopFrame()
     invokerFrame = thread.TopFrame()
     retVal = currentFrame.OperandStack().PopLong()
     invokerFrame.OperandStack().PushLong(retVal)
Exemplo n.º 24
0
def _fload(frame: rtda.Frame, index):
    val = frame.LocalVars().GetFloat(index)
    frame.OperandStack.PushFloat(val)
Exemplo n.º 25
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     d = stack.PopDoulbe()
     l = struct.unpack('>q', struct.pack('>d', d))[0]
     stack.pushInf(l)
Exemplo n.º 26
0
def _iload(frame: rtda.Frame, index):
    val = frame.LocalVars().GetInt(index)
    frame.OperandStack().PushInt(val)
Exemplo n.º 27
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     d = stack.PopDoulbe()
     f = struct.unpack('>f', struct.pack('>d', d))[0]
     stack.pushFloat(f)
Exemplo n.º 28
0
def branch(frame: Frame, offset):
    pc = frame.thread.pc
    next_pc = pc + offset
    frame.next_pc = next_pc
Exemplo n.º 29
0
def _lstore(frame: rtda.Frame, index):
    val = frame.OperandStack().PopLong()
    frame.LocalVars().SetLong(index, val)
Exemplo n.º 30
0
 def Execute(self, frame: rtda.Frame):
     stack = frame.OperandStack()
     v2 = stack.PopLong()
     v1 = statk.PopLong()
     result = v1 and v2
     stack.PushLong(result)