to emulate Pentium (+MMX?) on 486 class CPUs to allow you to run newer software
I successfully was able to catch the illegal instructions, but cannot figure out how to return to normal execution
Code: Select all
__declspec(naked) void illegal_operand_handler (void) {
__asm{
push ebp
mov ebp, esp
pushad
pushfd
push ds
mov ds, ax
mov esi, [ebp+4]
cld
lods byte ptr [esi]
cmp al, 0xf
je handle_0xf
GoPrevTrap01:
pop ds
popfd
popad
pop ebp
jmp dword ptr [prevIllegalOpHandler]
handle_0xf:
lods byte ptr [esi] //Find out what the faulting instruction is
cmp al, 0xA2
jne not_cpuid
add dword ptr [ebp+3], 4
pop ds
popfd
popad
pop ebp
iretd
not_cpuid:
jmp short GoPrevTrap01
};
}
Anybody help please?