use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class FCmpL method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext two = stack.pop();
StackContext one = stack.pop();
ins.pop(two, one);
Value result = Value.UNKNOWN;
if (!two.getValue().isUnknownOrNull() && !one.getValue().isUnknownOrNull()) {
float f2 = (float) two.getValue().getValue(), f1 = (float) one.getValue().getValue();
if (f1 > f2)
result = new Value(1);
else if (f1 == f2)
result = new Value(0);
else if (f1 < f2)
result = new Value(-1);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class FRem method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext two = stack.pop();
StackContext one = stack.pop();
ins.pop(two, one);
Value result = Value.UNKNOWN;
if (!two.getValue().isUnknownOrNull() && !one.getValue().isUnknownOrNull()) {
float f2 = (float) two.getValue().getValue(), f1 = (float) one.getValue().getValue();
if (f2 != 0.0f)
result = new Value(f1 % f2);
}
StackContext ctx = new StackContext(ins, Type.FLOAT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class FNeg method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
ins.pop(value);
Value result = Value.UNKNOWN;
if (!value.getValue().isUnknownOrNull()) {
float f = (float) value.getValue().getValue();
result = new Value(-f);
}
StackContext ctx = new StackContext(ins, Type.FLOAT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class Pop2 method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
ins.pop(value);
if (value.getType().getSize() == 2)
return ins;
value = stack.pop();
ins.pop(value);
return ins;
}
use of net.runelite.asm.execution.Stack in project runelite by runelite.
the class PutField method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext value = stack.pop();
StackContext object = stack.pop();
ins.pop(value, object);
if (myField != null) {
frame.getExecution().order(frame, myField);
}
return ins;
}
Aggregations