public JZ80InstructionListModel(JZ80Sim s) {
   sim = s;
   list = new Instruction[64];
   addresses = new int[64];
   offset = sim.getSystem().getCPU().getRegister(JZ80RegisterName.PC).readValue();
   refreshListFrom(offset);
 }
  public void refreshListFrom(int address) {
    JZ80System system = sim.getSystem();
    int i, j;
    offset = address;

    for (i = address, j = 0; j < list.length; j++) {
      addresses[j] = i;
      try {
        list[j] = system.fetchInstructionAt(i);
        i += list[j].getByteSize();
      } catch (JZ80InvalidInstructionException e) {
        // e.printStackTrace();
        i += 2; // TODO: por el momento suponemos que las instrucciones
        // desconocidas son de 2 bytes de largo
      }
    }

    fireContentsChanged(this, 0, getSize() - 1);
  }
  public JZ80StackListModel(JZ80Sim s) {
    sp = s.getSystem().getCPU().getRegister(JZ80RegisterName.SP);
    memory = s.getSystem().getMemory();

    refreshList();
  }