Log in

View Full Version : DVD VM instructions


xvi
28th May 2003, 12:14
Searching for the VM instructions description, I found discrepancies between ogle's and mpucoder's docs. e.g. type 5 & 6 instructions set destination register is (per mpucoder) the same as the left compare argument, while ogle specifies different field for both, allowing them to be different.
Another type 5-6 difference is that mpucoder lists immediate compare ability, and ogle's list them as illegal. This, of course, has a direct implication on RCE instruction patching (and I wish mpucoder is right).

So my question is: which doc must I really trust, mpucoder, ogle, or a third one?

xvi;

mpucoder
28th May 2003, 13:53
The vm instructions at MPUCoder are based almost entirely on the work of Ogle. I just spent the last hour looking over their recent changes (7 months ago, to these instructions specifically), and indeed my chart needs changing. I trust the work of this team, as they spend many hours reverse engineering the vm engine (mostly by authoring test cases).
This is what Ogle has changed to:
srd (the set operation destination register) does not change
indirect set (0.4 = 0) indirect cmp (1.7 = 0) byte2 = srs, byte3 = cr1 (the left side), byte4 = cr2
indirect set, direct cmp byte2 = srs, byte3=cr1, bytes4&5 = cval
direct set, indirect cmp bytes2&3 = sval, byte4 = cr1, byte5 = cr2
direct set and direct compare not possible

If you don't need the link portion of these commands, use type 3, they allow direct compare and direct set.

xvi
28th May 2003, 14:14
Thank you for your answer.
Originally posted by mpucoder
direct set and direct compare not possible
This is bad news for RCE patching, as replacing any SPRM(20) access by an immediate value isn't possible. So, a global analysis of the PGC is needed to check whether the condition is met or not.