Good day all! I have one more question and needed some inputs
from you guys.
This is regarding condition value (T/F). My program (Driver) prints out condition values in reversed way - which means it supposed to print out 'false' but it's giving 'true' value and vice versa.
Please refer my Driver class (excerpt):
Here is the IfInstruction class where I need to get value (T/F) when it encounters IF* statements:
So my idea is I have to consider reversing the condition so that true actually points to true and false points to false. What do you think? Please advise….many thanks
Shana
from you guys.
This is regarding condition value (T/F). My program (Driver) prints out condition values in reversed way - which means it supposed to print out 'false' but it's giving 'true' value and vice versa.
Please refer my Driver class (excerpt):
Code:
java.util.List ifs = new java.util.ArrayList();
Instruction insn = jvm.getLastInstruction();
………
………
if (insn instanceof IfInstruction)
{
IfInstruction iff = (IfInstruction) insn;
Object position = insn.getOffset();
boolean value = iff.getConditionValue(); //THE PROBLEM IS HERE ***
ifs.add(new Entry(position, value));
System.out.print(value);
System.out.println();
}
Code:
int target; /** jump offset */
boolean conditionValue; /** value of last evaluation of branch condition */
/**
* return which branch was taken. Only useful after instruction got executed
*/
public boolean getConditionValue()
{
return conditionValue;
}
Shana
Comment