예제 #1
0
파일: bt_Ew_Gw.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   Reg op2 = cpu.regs[op2Index];
   cpu.zf(cpu.zf());
   cpu.cf(((op1.get16() & (1 << (op2.get16() & (16 - 1)))) != 0));
   return Branch.None;
 }
예제 #2
0
파일: btr_Ew_Gw.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   Reg op2 = cpu.regs[op2Index];
   int bit = 1 << (op2.get16() & (16 - 1));
   cpu.cf = (0 != (op1.get16() & bit));
   cpu.flagStatus &= NCF;
   op1.set16((short) (op1.get16() & ~bit));
   return Branch.None;
 }
예제 #3
0
파일: adc_Ew_Ib.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   boolean incf =
       Processor.getCarryFlag(
           cpu.flagStatus, cpu.cf, cpu.flagOp1, cpu.flagOp2, cpu.flagResult, cpu.flagIns);
   cpu.flagOp1 = op1.get16();
   cpu.flagOp2 = immb;
   cpu.flagResult = (short) (cpu.flagOp1 + cpu.flagOp2 + (incf ? 1 : 0));
   op1.set16((short) cpu.flagResult);
   cpu.flagIns = UCodes.ADC16;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #4
0
파일: imul_Ew.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   int iop1 = (short) op1.get16();
   int iop2 = (short) cpu.r_eax.get16();
   int res32 = (((int) (short) iop1) * ((short) iop2));
   cpu.r_eax.set16((short) res32);
   cpu.r_edx.set16((short) (res32 >> 16));
   cpu.setOSZAPC_Logic16(res32);
   if (res32 != (short) res32) {
     cpu.of(true);
     cpu.cf(true);
   }
   return Branch.None;
 }