return sType == StackType.NOP;
}
<<<<<<< HEAD
private static Instruction[] ia = new Instruction[] {
//
// 'pop' instructions
//
new Instruction("pop", 0x000, 0, JmpType.NOP, StackType.POP),
new Instruction("and", 0x001, 0, JmpType.NOP, StackType.POP),
new Instruction("or", 0x002, 0, JmpType.NOP, StackType.POP),
new Instruction("xor", 0x003, 0, JmpType.NOP, StackType.POP),
new Instruction("add", 0x004, 0, JmpType.NOP, StackType.POP),
new Instruction("sub", 0x005, 0, JmpType.NOP, StackType.POP),
// st (vp) 3 bits
new Instruction("st0", 0x010 + 0, 0, JmpType.NOP, StackType.POP),
new Instruction("st1", 0x010 + 1, 0, JmpType.NOP, StackType.POP),
new Instruction("st2", 0x010 + 2, 0, JmpType.NOP, StackType.POP),
new Instruction("st3", 0x010 + 3, 0, JmpType.NOP, StackType.POP),
new Instruction("st", 0x010 + 4, 0, JmpType.NOP, StackType.POP),
new Instruction("stmi", 0x010 + 5, 0, JmpType.NOP, StackType.POP),
new Instruction("stvp", 0x018, 0, JmpType.NOP, StackType.POP),
new Instruction("stjpc", 0x019, 0, JmpType.NOP, StackType.POP),
new Instruction("star", 0x01a, 0, JmpType.NOP, StackType.POP),
new Instruction("stsp", 0x01b, 0, JmpType.NOP, StackType.POP),
// shift
new Instruction("ushr", 0x01c, 0, JmpType.NOP, StackType.POP),
new Instruction("shl", 0x01d, 0, JmpType.NOP, StackType.POP),
new Instruction("shr", 0x01e, 0, JmpType.NOP, StackType.POP),
// new Instruction("shift reserved", 0x1f, 0, JmpType.NOP, StackType.POP),
// 5 bits: 0x20-0x3f
new Instruction("stm", 0x020, 5, JmpType.NOP, StackType.POP),
// MMU 4 bit subfield selects function (pop type)
new Instruction("stmul", 0x040 + 0, 0, JmpType.NOP, StackType.POP),
new Instruction("stmwa", 0x040 + 1, 0, JmpType.NOP, StackType.POP),
new Instruction("stmra", 0x040 + 2, 0, JmpType.NOP, StackType.POP),
new Instruction("stmwd", 0x040 + 3, 0, JmpType.NOP, StackType.POP),
// array instructions
new Instruction("stald", 0x040 + 4, 0, JmpType.NOP, StackType.POP),
new Instruction("stast", 0x040 + 5, 0, JmpType.NOP, StackType.POP),
// getfield/putfield
new Instruction("stgf", 0x040 + 6, 0, JmpType.NOP, StackType.POP),
new Instruction("stpf", 0x040 + 7, 0, JmpType.NOP, StackType.POP),
// magic copying
new Instruction("stcp", 0x040 + 8, 0, JmpType.NOP, StackType.POP),
// bytecode read
new Instruction("stbcrd", 0x040 + 9, 0, JmpType.NOP, StackType.POP),
// store TOS to MMU index register for jopsys_*field
new Instruction("stidx", 0x040 + 0xa, 0, JmpType.NOP, StackType.POP),
// putstatic
new Instruction("stps", 0x040 + 0xb, 0, JmpType.NOP, StackType.POP),
//
// 'push' instructions
//
// 5 bits: 0xa0-0xbf
new Instruction("ldm", 0x0a0, 5, JmpType.NOP, StackType.PUSH),
// 5 bits: 0xc0-0xdf
new Instruction("ldi", 0x0c0, 5, JmpType.NOP, StackType.PUSH),
// MMU 4 bit subfield selects function (push type)
new Instruction("ldmrd", 0x0e0 + 0, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ldmul", 0x0e0 + 1, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ldbcstart", 0x0e0 + 2, 0, JmpType.NOP, StackType.PUSH),
// ld (vp) 3 bits
new Instruction("ld0", 0x0e8 + 0, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld1", 0x0e8 + 1, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld2", 0x0e8 + 2, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld3", 0x0e8 + 3, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld", 0x0e8 + 4, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ldmi", 0x0e8 + 5, 0, JmpType.NOP, StackType.PUSH),
// 2 bits
new Instruction("ldsp", 0x0f0 + 0, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ldvp", 0x0f0 + 1, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ldjpc", 0x0f0 + 2, 0, JmpType.NOP, StackType.PUSH),
// ld opd 2 bits
new Instruction("ld_opd_8u", 0x0f4 + 0, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld_opd_8s", 0x0f4 + 1, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld_opd_16u", 0x0f4 + 2, 0, JmpType.NOP, StackType.PUSH),
new Instruction("ld_opd_16s", 0x0f4 + 3, 0, JmpType.NOP, StackType.PUSH),
new Instruction("dup", 0x0f8, 0, JmpType.NOP, StackType.PUSH),
//
// 'no SP change' instructions
//
new Instruction("nop", 0x100, 0, JmpType.NOP, StackType.NOP),
new Instruction("wait", 0x101, 0, JmpType.NOP, StackType.NOP),
new Instruction("jbr", 0x102, 0, JmpType.NOP, StackType.NOP),
// no SP change instructions for MMU
// 4 bit subfield selects function (pop type)
// getstatic
new Instruction("stgs", 0x110 + 0x0, 0, JmpType.NOP, StackType.NOP),
// branches
new Instruction("bz", 0x180, 6, JmpType.BR, StackType.POP),
new Instruction("bnz", 0x1c0, 6, JmpType.BR, StackType.POP),
new Instruction("jmp", 0x200, 9, JmpType.JMP, StackType.NOP),
};
public static Map map = new HashMap();
public static Map imap = new TreeMap();
=======
private static Instruction[] ia = new Instruction[]
{
//
// 'pop' instructions
//
new Instruction("pop", 0x00<<2, false, false),
new Instruction("and", 0x01<<2, false, false),
new Instruction("or", 0x02<<2, false, false),
new Instruction("xor", 0x03<<2, false, false),
new Instruction("add", 0x04<<2, false, false),
new Instruction("sub", 0x05<<2, false, false),
// extension 'address' selects function 4 bits
// multiplication
new Instruction("stmul", 0x06<<2, false, false),
new Instruction("stmwa", 0x07<<2, false, false),
new Instruction("stmra", (0x08+0)<<2, false, false),
// cache hint for read from the class info (e.g. mtab)
new Instruction("stmra_cinfo", ((0x08+0)<<2)+1, false, false),
new Instruction("stmwd", (0x08+1)<<2, false, false),
// array instructions
new Instruction("stald", (0x08+2)<<2, false, false),
new Instruction("stast", (0x08+3)<<2, false, false),
// getfield/putfield
new Instruction("stgf", (0x08+4)<<2, false, false),
new Instruction("stpf", (0x08+5)<<2, false, false),
// magic copying
new Instruction("stcp", (0x08+6)<<2, false, false),
// bytecode read
new Instruction("stbcrd",(0x08+7)<<2, false, false),
// st (vp) 3 bits
new Instruction("st0", (0x10+0)<<2, false, false),
new Instruction("st1", (0x10+1)<<2, false, false),
new Instruction("st2", (0x10+2)<<2, false, false),
new Instruction("st3", (0x10+3)<<2, false, false),
new Instruction("st", (0x10+4)<<2, false, false),
new Instruction("stmi", (0x10+5)<<2, false, false),
new Instruction("stvp", 0x18<<2, false, false),
new Instruction("stjpc", 0x19<<2, false, false),
new Instruction("star", 0x1a<<2, false, false),
new Instruction("stsp", 0x1b<<2, false, false),
// shift
new Instruction("ushr", 0x1c<<2, false, false),
new Instruction("shl", 0x1d<<2, false, false),
new Instruction("shr", 0x1e<<2, false, false),
//new Instruction("shift reserved", 0x1f<<2, false, false),
// 5 bits
new Instruction("stm", 0x20<<2, true, false),
new Instruction("bz", 0x40<<2, true, true),
new Instruction("bnz", 0x60<<2, true, true),
//
// 'no sp change' instructions
//
new Instruction("nop", 0x80<<2, false, false),
new Instruction("wait", 0x81<<2, false, false),
new Instruction("jbr", 0x82<<2, false, false),
//
// 'push' instructions
//
// 5 bits
new Instruction("ldm", 0xa0<<2, true, false),
new Instruction("ldi", 0xc0<<2, true, false),
// extension 'address' selects function 4 bits
new Instruction("ldmrd", (0xe0+0)<<2, false, false),
new Instruction("ldmul", (0xe0+6)<<2, false, false),
new Instruction("ldbcstart", (0xe0+7)<<2, false, false),
// ld (vp) 3 bits
new Instruction("ld0", (0xe8+0)<<2, false, false),
new Instruction("ld1", (0xe8+1)<<2, false, false),
new Instruction("ld2", (0xe8+2)<<2, false, false),
new Instruction("ld3", (0xe8+3)<<2, false, false),
new Instruction("ld", (0xe8+4)<<2, false, false),
new Instruction("ldmi", (0xe8+5)<<2, false, false),
// 2 bits
new Instruction("ldsp", (0xf0+0)<<2, false, false),
new Instruction("ldvp", (0xf0+1)<<2, false, false),
new Instruction("ldjpc", (0xf0+2)<<2, false, false),
// ld opd 2 bits
new Instruction("ld_opd_8u", (0xf4+0)<<2, false, false),
new Instruction("ld_opd_8s", (0xf4+1)<<2, false, false),
new Instruction("ld_opd_16u", (0xf4+2)<<2, false, false),
new Instruction("ld_opd_16s", (0xf4+3)<<2, false, false),
new Instruction("dup", (0xf8)<<2, false, false),
};
public static Map map = new HashMap();
public static Map imap = new TreeMap();
>>>>>>> c8638bace4f53b8a7a348f07af012563022a21bc
static {
for (int i = 0; i < ia.length; ++i) { |