示例#1
0
bool IsWtk( instruction * curr_ins )
//=================================
{
    operand *   op  = &curr_ins->op[ curr_ins->mem_ref_op ];
    char *      sym = FindSymbol( InsAddr + op->offset );
    bool        retn = false;

    if( /* Pass == 2  &&   so that didAnyWtk can be set */
        ( Options & FORM_DO_WTK ) ) {
        if( strstr( sym, WTLBASEStr ) != NULL ) {
            fixup *     fix = FindFixup( InsAddr + op->offset, Segment );
            if( fix != NULL ) {
                WtkAddr = fix->imp_address + ( fix->seg_address << 4 );
                retn = true;
            }
        } else if( WtlsegPresent  &&  ( curr_ins->pref & PREF_FS )  &&
                   curr_ins->seg_used == FS_REG  &&  sym == NULL ) {
            WtkAddr = op->disp;
            retn = true;
        }
    }
    if( retn ) {
        didAnyWtk = true;
    }
    if( Pass == 2 ) {
        return( retn );
    } else {
        return( false );
    }
}
示例#2
0
char  *FindSymbol( uint_32 ref )
/******************************/
{
    fixup               *fix;
    char                *name;

    name = NULL;
    fix = FindFixup( ref, Segment );
    if( fix != NULL ) {
        name = GetFixName( fix );
        if( name == NULL ) {
            name = NewName( fix );
        }
    }
    return( name );
}
示例#3
0
char  *FindLabel( uint_32 ref, uint_32 addr, segment *seg )
/*********************************************************/
{
    char                *name;
    fixup               *fix;

    switch( _Class( seg ) ) {
    case TYPE_IMPORT:               /* fall through */
    case TYPE_COMDEF:
        name = FormSym( _Name( seg ) );
        break;
    case TYPE_GROUP:
        name = _Name( seg );
        break;
    default:
        if( ref == BAD_OFFSET ) {
            fix = NULL;
        } else {
            fix = FindFixup( ref, seg );
        }
        if( fix == NULL ) {
            name = FindExpName( addr, seg );
            if( name == NULL ) {
                AddLabel( addr, NULL, seg, false, false );
            }
        } else {
            name = GetFixName( fix );
            if( name == NULL ) {
                AddLabel( fix->imp_address, NULL, seg, false, false );
                name = FindExpName( fix->imp_address, seg );
            }
        }
        break;
    }
    return( name );
}