use of net.runelite.asm.execution.Value in project runelite by runelite.
the class IShL 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()) {
int i2 = (int) two.getValue().getValue(), i1 = (int) one.getValue().getValue();
result = new Value(i1 << i2);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Value in project runelite by runelite.
the class IAdd 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()) {
int i2 = (int) two.getValue().getValue(), i1 = (int) one.getValue().getValue();
result = new Value(i1 + i2);
}
StackContext ctx = new StackContext(ins, Type.INT, result);
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Value in project runelite by runelite.
the class BiPush method execute.
@Override
public InstructionContext execute(Frame frame) {
InstructionContext ins = new InstructionContext(this, frame);
Stack stack = frame.getStack();
// bipush sign extends the value to an int
StackContext ctx = new StackContext(ins, Type.INT, new Value((int) b));
stack.push(ctx);
ins.push(ctx);
return ins;
}
use of net.runelite.asm.execution.Value in project runelite by runelite.
the class FAdd 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();
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.Value in project runelite by runelite.
the class FCmpG 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;
}
Aggregations