Example #1
0
dis_handler_return SPARCMem( dis_handle *h, void *d, dis_dec_ins *ins )
{
    sparc_ins   code;
    int         mem_op;
    int         reg_op;

    code.full = _SparcIns( ins->opcode );
    getOpIndices( code, &mem_op, &reg_op );
    ins->op[ reg_op ].type = DO_REG;
    ins->op[ reg_op ].base = _SparcReg( code.op3.rd );
    ins->op[ mem_op ].ref_type = integerRefTypes[ code.op3.opcode_3 & 0x03 ];
    doSparcMem( h, d, &ins->op[ mem_op ], code );
    ins->num_ops = 2;
    return( DHR_DONE );
}
Example #2
0
dis_handler_return SPARCMemC( dis_handle *h, void *d, dis_dec_ins *ins )
{
    sparc_ins   code;
    int         mem_op;
    int         reg_op;

    code.full = _SparcIns( ins->opcode );
    getOpIndices( code, &mem_op, &reg_op );
    ins->op[ reg_op ].type = DO_REG;
    ins->op[ reg_op ].base = _SparcCReg( code.op3.rd );
    ins->op[ mem_op ].ref_type = coproRefTypes[ code.op3.opcode_3 & 0x03 ];
    doSparcMem( h, d, &ins->op[ mem_op ], code );
    if( code.op3.opcode_3 == 0x31 || code.op3.opcode_3 == 0x35 ) {
        // special case for ldcsr/stcsr instructions
        ins->op[ reg_op ].base = DR_SPARC_csr;
    }
    if( code.op3.opcode_3 == 0x36 ) {
        // another special case - stdcq instruction
        ins->op[ reg_op ].base = DR_SPARC_cq;
    }
    ins->num_ops = 2;
    return( DHR_DONE );
}