qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU


From: Atif Hashmi
Subject: Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU
Date: Sat, 7 Apr 2007 16:06:19 -0500

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 <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]