-
Notifications
You must be signed in to change notification settings - Fork 1
/
MetaInstruction.java
50 lines (39 loc) · 1.17 KB
/
MetaInstruction.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.isk.jvmhardcore.pjba.instruction.meta;
public abstract class MetaInstruction {
final private String mnemonic;
final private String pjbMnemonic;
final private ArgsType argsType;
protected int opcode;
public MetaInstruction(final String mnemonic, final ArgsType argsType) {
this(mnemonic, mnemonic, argsType);
}
public MetaInstruction(final String mnemonic, final String pjbMnemonic, final ArgsType argsType) {
super();
this.mnemonic = mnemonic;
this.pjbMnemonic = pjbMnemonic;
this.argsType = argsType;
}
public int getOpcode() {
return this.opcode;
}
public String getMnemonic() {
return this.mnemonic;
}
public ArgsType getArgsType() {
return this.argsType;
}
public String getPjbMnemonic() {
return this.pjbMnemonic;
}
public static enum ArgsType {
NONE,
BYTE_VALUE, // => 1 byte
SHORT_VALUE, // => 1 short
IFS_CONSTANT, // int, float and String => 1 byte
W_IFS_CONSTANT, // int, float and String => 1 short
LD_CONSTANT, // long and double => 1 short
IINC, // byte, byte
WIDE, // 1 byte + 1 short or 1 byte + 1 short + 1 short
LV_INDEX // => 1 byte or 1 short
}
}