예제 #1
0
static  bool    LblName( label_handle lbl, bool no_prefix )
/*********************************************************/
{
    if( !ValidLbl( lbl ) )
        return( false );
    if( no_prefix ) {
        if( lbl->lbl.sym == NULL ) {
            return( false );
        }
    } else {
        DumpChar( 'L' );
        DumpPtr( lbl );
        if( lbl->lbl.sym == NULL ) {
            return( true );
        }
    }
    DumpChar( '(' );
    if( AskIfRTLabel( lbl ) ) {
        DumpXString( AskRTName( SYM2RTIDX( lbl->lbl.sym ) ) );
    } else if( AskIfCommonLabel( lbl ) ) {
        DumpLiteral( "Common import => [" );
        DumpUInt( (unsigned)(pointer_int)lbl->lbl.sym );
        DumpLiteral( "] " );
    } else {
        DumpXString( FEName( lbl->lbl.sym ) );
    }
    DumpChar( ')' );
    return( true );
}
예제 #2
0
static  void    DumpScList( score_list *curr )
/********************************************/
{
    DumpLiteral( "    " );
    switch( curr->info.class ) {
    case SC_N_CONSTANT:
        DumpChar( '&' );
        DumpLong( curr->info.offset );
        break;
    case SC_N_TEMP:
        DumpChar( 't' );
        DumpInt( curr->info.symbol.t->v.id );
        DumpLiteral( " offset " );
        DumpLong( curr->info.offset );
        break;
    case SC_N_MEMORY:
        DumpXString( FEName( curr->info.symbol.p ) );
        DumpLiteral( " offset " );
        DumpLong( curr->info.offset );
        break;
    case SC_N_INDEXED:
        if( curr->info.base == NULL ) {
            ;
        } else if( curr->info.base->n.class == N_TEMP ) {
            DumpChar( 't' );
            DumpInt( curr->info.base->t.v.id );
            DumpChar( '+' );
        } else {
            DumpXString( FEName( curr->info.base->v.symbol ) );
            DumpChar( '+' );
        }
        DumpLong( curr->info.offset );
        DumpChar( '[' );
        DumpRegName( ScoreList[curr->info.index_reg]->reg );
        DumpChar( ']' );
        break;
    case SC_N_INITIAL:
        DumpLiteral( "INITIAL(" );
        DumpLong( curr->info.offset );
        DumpChar( ')' );
        break;
    case SC_N_VOLATILE:
        DumpLiteral( "VOLATILE - Oh No!" );
        break;
    case SC_N_ADDRESS:
        DumpLiteral( "ADDRESS(" );
        DumpOperand(curr->info.symbol.p);
        DumpChar( ')' );
        break;
    }
예제 #3
0
static  bool    LblName( code_lbl *lbl ) {
/*****************************************/


    if( ValidLbl( lbl ) == FALSE ) return( FALSE );
    DumpLiteral( "L" );
    DumpPtr( lbl );
    if( lbl->lbl.sym == NULL ) return( TRUE );
    DumpLiteral( "(" );
    if( AskIfRTLabel( lbl ) ) {
        DumpXString( AskRTName( (rt_class)(pointer_int)lbl->lbl.sym ) );
    } else if( AskIfCommonLabel( lbl ) ) {
        DumpLiteral( "Common import => [" );
        DumpInt( (int)(pointer_int)lbl->lbl.sym );
        DumpLiteral( "] " );
    } else {
        DumpXString( FEName( lbl->lbl.sym ) );
    }
    DumpLiteral( ")" );
    return( TRUE );
}
예제 #4
0
static  bool    LblName( label_handle lbl ) {
/*****************************************/


    if( ValidLbl( lbl ) == false ) return( false );
    DumpChar( 'L' );
    DumpPtr( lbl );
    if( lbl->lbl.sym == NULL ) return( true );
    DumpChar( '(' );
    if( AskIfRTLabel( lbl ) ) {
        DumpXString( AskRTName( (rt_class)(pointer_int)lbl->lbl.sym ) );
    } else if( AskIfCommonLabel( lbl ) ) {
        DumpLiteral( "Common import => [" );
        DumpInt( (int)(pointer_int)lbl->lbl.sym );
        DumpLiteral( "] " );
    } else {
        DumpXString( FEName( lbl->lbl.sym ) );
    }
    DumpChar( ')' );
    return( true );
}
예제 #5
0
extern  void    DumpOperand( name *operand ) {
/********************************************/

    char        buffer[20];
    hw_reg_set  reg;
    name        *base;

    if( operand->n.class == N_INDEXED ) {
        if( operand->i.base != NULL ) {
            if( !( operand->i.index_flags & X_FAKE_BASE ) ) {
                if( operand->i.index_flags & X_LOW_ADDR_BASE ) {
                    DumpLiteral( "l^" );
                }
                DumpOperand( operand->i.base );
                if( operand->i.constant > 0 ) {
                    DumpChar( '+' );
                }
            }
        }
        if( operand->i.constant != 0 ) {
            DumpLong( operand->i.constant );
        }
        DumpChar( '[' );
        if( operand->i.index_flags & X_BASE ) {
            reg = operand->i.index->r.reg;
#if _TARGET & ( _TARG_IAPX86 | _TARG_80386 )
            if( HW_COvlap( reg, HW_SEGS ) ) {

                hw_reg_set tmp;

                tmp = reg;
                HW_COnlyOn( tmp, HW_SEGS );
                DumpRegName( tmp );
                DumpChar( ':' );
                HW_CTurnOff( reg, HW_SEGS );
            }
#endif
            if( operand->i.index_flags & X_HIGH_BASE ) {
                DumpRegName( HighReg( reg ) );
                DumpChar( '+' );
                DumpRegName( LowReg( reg ) );
            } else {
                DumpRegName( LowReg( reg ) );
                DumpChar( '+' );
                DumpRegName( HighReg( reg ) );
            }
        } else {
            DumpOperand( operand->i.index );
        }
        if( operand->i.scale != 0 ) {
            DumpChar( '*' );
            DumpInt( 1 << operand->i.scale );
        }
        if( operand->i.index_flags & ( X_ALIGNED_1 | X_ALIGNED_2 | X_ALIGNED_4 | X_ALIGNED_8 ) ) {
            DumpChar( '$' );
            DumpInt( FlagsToAlignment( operand->i.index_flags ) );
        }
        DumpChar( ']' );
        base = operand->i.base;
        if( base != NULL ) {
            if( operand->i.index_flags & X_FAKE_BASE ) {
                DumpChar( '{' );
                if( base->n.class == N_MEMORY ) {
                    DumpXString( AskName(base->v.symbol, base->m.memory_type) );
                } else if( base->n.class == N_TEMP ) {
                    if( _FrontEndTmp( base ) ) {
                        DumpXString( FEName( base->v.symbol ) );
                    } else {
                        DumpOperand( base );
                    }
                }
                DumpChar( '}' );
            }
        }