Hi Eduardo,

I really appreciate your help but there is a small think that I need to ask
you.

In target-i386/translate.c, there are many variants of mov i.e.
case 0x89: /* mov Gv, Ev */
case 0xc7: /* mov Ev, Iv */
case 0x8b: /* mov Ev, Gv */
case 0x8e: /* mov seg, Gv */

which one do you think will be called when "mov %eax, %eax" instruction is
translated.
I printed the value of modrm inside the case 0x89 but the value remains the
same whether I use %eax or %ebx.

Secondly, How can I extract the source and destination registers from modrm.

I will really appreciate your help.

Thanks,
Atif


On 4/6/07, Eduardo Felipe <[EMAIL PROTECTED]> wrote:

Hi,

Your should create a new helper function in \target-i386\helper.c to
perform whatever you want QEMU to do when movl %eax,%eax is found.

To invoke that function create a new opcode in \target-i386\op.c. That
opcode should only call your helper function.

Finally, modify \target-i386\translate.c to generate your opcode when movl
%eax,%eax is translated. Look for the string 0x89, you can find out target
and source registers of the move operation from variable modrm, so only %eax
is considered.

Regards,
Eduardo



Reply via email to