Exemple #1
0
  public void execute(VM vm) {
    ModRM modrm = vm.getModRM();
    int src = modrm.getRMValue8();
    int dest = modrm.getRegister8();

    int result = src & dest;
    FlagCheck.check(src, result, vm.getEFlags(), 8);

    vm.addEIP(2);
  }
Exemple #2
0
  public void execute(VM vm) {
    long ax = vm.getRegisterX(EAX);
    long imm = vm.getCodeX(1);

    long result = ax - imm - (vm.getEFlags().isCarry() ? 1 : 0);
    FlagCheck.subCheck(ax, imm, result, vm.getEFlags(), vm.is32bitOperand() ? 32 : 16);
    vm.setRegisterX(EAX, result);

    vm.addEIP(vm.is32bitOperand() ? 5 : 3);
  }