IO指令模拟流程(2)

来源:互联网 发布:天津摩卡软件 编辑:程序博客网 时间:2024/05/15 23:51

hvm_emulate_onex86_emulate

x86_emulate中完成具体分析模拟指令的动作。

1)       分析指令前缀

2)       分析操作码长度

3)       分析获得源操作数

4)       分析获得目的操作数

5)       进行具体的指令操作

int

x86_emulate(

    struct x86_emulate_ctxt *ctxt,

    const struct x86_emulate_ops  *ops)

{

    1)/* Prefix bytes. */

    for ( ; ; )

{

 

    2)/* Opcode byte(s). */

    d = opcode_table[b];

 

    3)/* Decode and fetch the source operand: register, memory or immediate. */

    switch ( d & SrcMask )

{

 

    4)/* Decode and fetch the destination operand: register or memory. */

    ……

原创粉丝点击