use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class DMul 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()) {
double d2 = (double) two.getValue().getValue(), d1 = (double) one.getValue().getValue();
result = new Value(d1 * d2);
}
StackContext ctx = new StackContext(ins, Type.DOUBLE, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class DNeg 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()) {
double d = (double) value.getValue().getValue();
result = new Value(-d);
}
StackContext ctx = new StackContext(ins, Type.DOUBLE, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class DRem 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()) {
double d2 = (double) two.getValue().getValue(), d1 = (double) one.getValue().getValue();
if (d2 != 0.0d)
result = new Value(d1 % d2);
}
StackContext ctx = new StackContext(ins, Type.DOUBLE, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class DStore method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
Variables variables = frame.getVariables();
StackContext value = stack.pop();
ins.pop(value);
variables.set(index, new VariableContext(ins, value));
return ins;
}
use of net.runelite.asm.execution.InstructionContext in project runelite by runelite.
the class Dup method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
StackContext obj = stack.pop();
ins.pop(obj);
StackContext ctx = new StackContext(ins, obj.getType(), obj.getValue());
stack.push(ctx);
ins.push(ctx);
ctx = new StackContext(ins, obj.getType(), obj.getValue());
stack.push(ctx);
ins.push(ctx);
return ins;
}
Aggregations