Click here to Skip to main content
13,867,180 members
Rate this:
Please Sign up or sign in to vote.
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();
_asm {
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.
Updated 26-Oct-17 5:05am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190214.1 | Last Updated 26 Oct 2017
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100