Esempio n. 1
0
  public Branch execute(Processor cpu) {
    int selector = op1.get16(cpu) & 0xffff;

    if (selector == 0) {
      cpu.ldtr = SegmentFactory.NULL_SEGMENT;
    } else {
      Segment newSegment = cpu.getSegment(selector & ~0x4);
      if (newSegment.getType() != 0x02)
        throw new ProcessorException(ProcessorException.Type.GENERAL_PROTECTION, selector, true);

      if (!(newSegment.isPresent()))
        throw new ProcessorException(ProcessorException.Type.GENERAL_PROTECTION, selector, true);
      cpu.ldtr = newSegment;
    }
    return Branch.None;
  }
Esempio n. 2
0
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   Segment seg = cpu.segs[segIndex];
   op1.set16((short) seg.getSelector());
   return Branch.None;
 }