VirtualBox

Changeset 38079 in vbox


Ignore:
Timestamp:
Jul 19, 2011 5:25:00 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
73025
Message:

IEM: Implemented AAM, fixed AAD.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h

    r37918 r38079  
    29452945    pCtx->ax = al;
    29462946    iemHlpUpdateArithEFlagsU8(pIemCpu, al,
    2947                               X86_EFL_SF | X86_EFL_SF | X86_EFL_PF,
     2947                              X86_EFL_SF | X86_EFL_ZF | X86_EFL_PF,
    29482948                              X86_EFL_OF | X86_EFL_AF | X86_EFL_CF);
    29492949
     
    29522952}
    29532953
     2954
     2955/**
     2956 * Implements 'AAM'.
     2957 *
     2958 * @param   enmEffOpSize    The effective operand size.
     2959 */
     2960IEM_CIMPL_DEF_1(iemCImpl_aam, uint8_t, bImm)
     2961{
     2962    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
     2963
     2964    uint16_t const ax = pCtx->ax;
     2965    uint8_t const  al = (uint8_t)ax % bImm;
     2966    uint8_t const  ah = (uint8_t)ax / bImm;
     2967    pCtx->ax = (ah << 8) + al;
     2968    iemHlpUpdateArithEFlagsU8(pIemCpu, al,
     2969                              X86_EFL_SF | X86_EFL_ZF | X86_EFL_PF,
     2970                              X86_EFL_OF | X86_EFL_AF | X86_EFL_CF);
     2971
     2972    iemRegAddToRip(pIemCpu, cbInstr);
     2973    return VINF_SUCCESS;
     2974}
    29542975
    29552976
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h

    r38077 r38079  
    98339833
    98349834/** Opcode 0xd4. */
    9835 FNIEMOP_STUB(iemOp_aam_Ib);
     9835FNIEMOP_DEF(iemOp_aam_Ib)
     9836{
     9837    IEMOP_MNEMONIC("aam Ib");
     9838    uint8_t bImm; IEM_OPCODE_GET_NEXT_U8(&bImm);
     9839    IEMOP_HLP_NO_LOCK_PREFIX();
     9840    IEMOP_HLP_NO_64BIT();
     9841    return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_aam, bImm);
     9842}
    98369843
    98379844
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette