Пример #1
0
  public static String disassemble(ARM7TDMI cpu, MemoryInterface memory, int opcode, int offset) {
    int instruction = (opcode >>> 8) & 0x000F;
    if (instruction >= InstructionName.length) return "[ unknown ]";
    int label = offset + 4 + (((byte) (opcode & 0x00FF)) << 1);

    return InstructionName[instruction] + " " + Hex.toAddrString(label, Hex.Word);
  }
Пример #2
0
  public static String disassemble(ARM7TDMI cpu, MemoryInterface memory, int opcode, int offset) {
    int instruction = (opcode >>> 11) & 0x0001;
    String rd = cpu.getRegisterName((opcode >>> 8) & 0x0007);
    String sp = cpu.getRegisterName(13);
    int off = (opcode & 0x00FF) << 2;

    return InstructionName[instruction]
        + " "
        + rd
        + ", ["
        + sp
        + ", "
        + Hex.toHexString(off, Hex.Bit_12)
        + "]";
  }