I'm trying to revive an old Win32 game that uses 3DNow! instruction set to make 3D rendering. On modern OSs like Win7 - Win10 instructions like FPADD are not allowed and the program throws an exception.
Since the number of 3DNow! instuctions used by the game is very limited, in my VS2008 MFC program I tried to use vectored exception handling to get the value of MMX registers, emulate the 3DNow! instructions by C code and push the values back to the processor 3DNow! registers.
My problem is that, no matter how I try to update the MMX register values (that is, for this game 8 couples of 32 bit float values, mm0 to mm7) at next exception the register values seem unchanged.
What I have tried:
The coding I used is like this snap:
float fval = emulated_instruction_value();
movq fval, mm0
The code is probably wrong for improper data types, but what puzzles me is the fact that the mmx values are never updated.
** updated **
Some simpler code showed that apparently when I use moveq to get mmx values I get correct values, but when I reverse the order of the operands and try to update a mmx register value I don't succeed, its value remains unchanged.