Skip to content

Commit

Permalink
EMMS instruction shoots INT 6 (MMX instruction not supported in 486).
Browse files Browse the repository at this point in the history
  • Loading branch information
captainys committed Feb 8, 2025
1 parent 758b548 commit 95e00d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cpu/i486inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ void i486DXCommon::MakeOpCodeRenumberTable(void)
opCodeRenumberTable[I486_OPCODE_XADD_RM8_R8]=I486_RENUMBER_XADD_RM8_R8;
opCodeRenumberTable[I486_OPCODE_XADD_RM_R]=I486_RENUMBER_XADD_RM_R;
opCodeRenumberTable[I486_OPCODE_CPUID]=I486_RENUMBER_CPUID;
opCodeRenumberTable[I486_OPCODE_EMMS]=I486_RENUMBER_EMMS;



Expand Down Expand Up @@ -464,7 +465,7 @@ void i486DXCommon::MakeOpCodeRenumberTable(void)
opCodeNeedOperandTable[I486_OPCODE_XCHG_EAX_EDI]=I486_NEEDOPERAND_NONE;
opCodeNeedOperandTable[I486_OPCODE_XLAT]=I486_NEEDOPERAND_NONE;
opCodeNeedOperandTable[I486_OPCODE_CPUID]=I486_NEEDOPERAND_NONE;

opCodeNeedOperandTable[I486_OPCODE_EMMS]=I486_NEEDOPERAND_NONE;

// RM_IMM8
opCodeNeedOperandTable[I486_OPCODE_C0_ROL_ROR_RCL_RCR_SAL_SAR_SHL_SHR_RM8_I8]=I486_NEEDOPERAND_RM_IMM8;
Expand Down Expand Up @@ -3384,6 +3385,10 @@ std::string i486DXCommon::Instruction::Disassemble(const Operand &op1In,const Op
case I486_OPCODE_CPUID:
disasm="CPUID";
break;

case I486_OPCODE_EMMS:
disasm="EMMS(INT 6)";
break;
}

if(INST_PREFIX_LOCK==instPrefix)
Expand Down
4 changes: 4 additions & 0 deletions src/cpu/i486inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,8 @@ enum
I486_OPCODE_XADD_RM_R= 0x0FC1,

I486_OPCODE_CPUID= 0x0FA2,

I486_OPCODE_EMMS= 0x0F77, // EMMS. Not supported. Shoots INT 6
};

enum
Expand Down Expand Up @@ -1218,6 +1220,8 @@ enum

I486_RENUMBER_REALLY_UNDEFINED,

I486_RENUMBER_EMMS, // EMMS. Not supported. Shoot INT 6

I486_NUM_SUPPORTED_INSTRUCTIONS,
};

Expand Down
1 change: 1 addition & 0 deletions src/cpu/i486runinstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -2167,6 +2167,7 @@ unsigned int i486DXFidelityLayer<FIDELITY>::RunOneInstruction(Memory &mem,InOut
{
case I486_RENUMBER_UNDEFINED_SHOOT_INT6:
case I486_RENUMBER_UNDEFINED_SHOOT_INT6_WIN31:
case I486_RENUMBER_EMMS: // 0x0F77 MMX instruction. Used in the Win95 Media-Player Installer.
Interrupt(INT_INVALID_OPCODE,mem,0,0,false);
EIPIncrement=0;
clocksPassed=ClocksForHandlingException();
Expand Down

0 comments on commit 95e00d8

Please sign in to comment.