01: package net.sf.jdec.jvminstructions.commands;
02:
03: import net.sf.jdec.commonutil.Numbers;
04: import net.sf.jdec.core.GlobalVariableStore;
05: import net.sf.jdec.core.Operand;
06: import net.sf.jdec.core.OperandStack;
07: import net.sf.jdec.reflection.Behaviour;
08: import net.sf.jdec.ui.util.UIUtil;
09:
10: public class BipushCommand extends AbstractInstructionCommand {
11:
12: public BipushCommand(Behaviour context) {
13: super (context);
14:
15: }
16:
17: public int getSkipBytes() {
18: return 1;
19: }
20:
21: public void execute() {
22: byte[] info = getContext().getCode();
23: int currentForIndex = getCurrentInstPosInCode();
24: int opValueB = info[(currentForIndex + 1)];
25: OperandStack opStack = getContext().getOpStack();
26: java.lang.String nonascii = UIUtil.getUIUtil()
27: .getInterpretNonAscii();
28: java.lang.String sopValueB = "";
29: StringBuffer sbf = new StringBuffer("");
30: sopValueB = Numbers.formatCharForNonAsciiValue(opValueB, sbf);
31: if (sbf.toString().equals("nonascii")) {
32: if (nonascii.equals("true")) {
33:
34: } else {
35: sopValueB = "" + opValueB;
36: }
37: }
38: Operand op = new Operand();
39: java.lang.String tp = null;
40: if (GlobalVariableStore.getPushTypes() != null) {
41: tp = (java.lang.String) GlobalVariableStore.getPushTypes()
42: .get(new Integer(currentForIndex));
43: if (tp != null) {
44: tp = "(" + tp + ")" + sopValueB;
45: }
46:
47: }
48: if (tp != null) {
49: op.setOperandValue(tp);// // new Integer(opValueI));
50: } else
51:
52: {
53: op.setOperandValue("" + sopValueB);
54: }
55:
56: boolean r = false;// checkIFLoadInstIsPartOFTernaryCond(currentForIndex);
57: if (r) {
58: if (opStack.size() > 0) {
59: java.lang.String str = opStack.getTopOfStack()
60: .getOperandValue();
61: str = str + op.getOperandValue();
62: op.setOperandValue(str);
63: }
64: }
65: opStack.push(op);
66: }
67:
68: }
|