예제 #1
0
파일: test_Ed_Id.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   cpu.of = cpu.af = cpu.cf = false;
   cpu.flagResult = (op1.get32() & immd);
   cpu.flagStatus = SZP;
   return Branch.None;
 }
예제 #2
0
 public Branch execute(Processor cpu) {
   cpu.flagOp1 = (byte) op1.get8(cpu);
   cpu.flagOp2 = (byte) immb;
   cpu.flagResult = (byte) (cpu.flagOp1 - cpu.flagOp2);
   cpu.flagIns = UCodes.SUB8;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #3
0
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   cpu.of = cpu.af = cpu.cf = false;
   cpu.flagResult = (byte) (op1.get8() ^ op2.get8(cpu));
   op1.set8((byte) cpu.flagResult);
   cpu.flagStatus = SZP;
   return Branch.None;
 }
예제 #4
0
파일: neg_Ed_mem.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   cpu.flagOp1 = op1.get32(cpu);
   cpu.flagResult = (-cpu.flagOp1);
   op1.set32(cpu, cpu.flagResult);
   cpu.flagIns = UCodes.NEG32;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #5
0
 public Branch execute(Processor cpu) {
   cpu.flagOp1 = cpu.r_eax.get32();
   cpu.flagOp2 = immd;
   cpu.flagResult = (cpu.flagOp1 - cpu.flagOp2);
   cpu.flagIns = UCodes.SUB32;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #6
0
 public Branch execute(Processor cpu) {
   cpu.flagOp1 = cpu.r_eax.get16();
   cpu.flagOp2 = immw;
   cpu.flagResult = (short) (cpu.flagOp1 - cpu.flagOp2);
   cpu.flagIns = UCodes.SUB16;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #7
0
 public Branch execute(Processor cpu) {
   cpu.flagOp1 = (short) op1.get16(cpu);
   cpu.flagOp2 = (short) immw;
   cpu.flagResult = (short) (cpu.flagOp1 - cpu.flagOp2);
   op1.set16(cpu, (short) cpu.flagResult);
   cpu.flagIns = UCodes.SUB16;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #8
0
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   cpu.flagOp1 = op1.get32();
   cpu.flagOp2 = op2.get32(cpu);
   cpu.flagResult = (cpu.flagOp1 - cpu.flagOp2);
   op1.set32(cpu.flagResult);
   cpu.flagIns = UCodes.SUB32;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #9
0
 public Branch execute(Processor cpu) {
   Reg op2 = cpu.regs[op2Index];
   int add = (cpu.cf() ? 1 : 0);
   cpu.flagOp1 = op1.get8(cpu);
   cpu.flagOp2 = op2.get8();
   cpu.flagResult = (byte) (cpu.flagOp1 - (cpu.flagOp2 + add));
   op1.set8(cpu, (byte) cpu.flagResult);
   cpu.flagIns = UCodes.SBB8;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #10
0
파일: add_Eb_Gb.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   Reg op2 = cpu.regs[op2Index];
   cpu.flagOp1 = (byte) op1.get8();
   cpu.flagOp2 = (byte) op2.get8();
   cpu.flagResult = (byte) (cpu.flagOp1 + cpu.flagOp2);
   op1.set8((byte) cpu.flagResult);
   cpu.flagIns = UCodes.ADD8;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #11
0
파일: adc_Gb_Eb.java 프로젝트: agimat/JPC
 public Branch execute(Processor cpu) {
   Reg op1 = cpu.regs[op1Index];
   Reg op2 = cpu.regs[op2Index];
   boolean incf = cpu.cf();
   cpu.flagOp1 = op1.get8();
   cpu.flagOp2 = op2.get8();
   cpu.flagResult = (byte) (cpu.flagOp1 + cpu.flagOp2 + (incf ? 1 : 0));
   op1.set8((byte) cpu.flagResult);
   cpu.flagIns = UCodes.ADC8;
   cpu.flagStatus = OSZAPC;
   return Branch.None;
 }
예제 #12
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;
 }
예제 #13
0
 public Branch execute(Processor cpu) {
   int shift = cpu.r_cl.get8() & 0x1f;
   if (shift != 0) {
     if (shift <= 16) {
       cpu.flagStatus = OSZPC;
     } else {
       cpu.flagStatus = SZP;
       cpu.of = false;
       cpu.cf = false;
     }
     cpu.af = false;
     cpu.flagOp1 = op1.get32(cpu);
     cpu.flagOp2 = shift;
     cpu.flagResult = (cpu.flagOp1 << cpu.flagOp2);
     op1.set32(cpu, cpu.flagResult);
     cpu.flagIns = UCodes.SHL32;
   }
   return Branch.None;
 }
예제 #14
0
 public Branch execute(Processor cpu) {
   cpu.of = cpu.af = cpu.cf = false;
   cpu.flagResult = (op1.get32(cpu) & immd);
   cpu.flagStatus = SZP;
   return Branch.None;
 }