Ejemplo n.º 1
0
AUX_INFO *AsmSysCreateAux( const char *name )
/*******************************************/
{
    CreateAux( name );
    AuxCopy( CurrInfo, &WatcallInfo );
    CurrInfo->use = 1;
    CurrInfo->save = asmRegsSaved;
    CurrEntry->info = CurrInfo;
    return( CurrInfo );
}
Ejemplo n.º 2
0
void XferPragInfo( char *from, char *to )
/***************************************/
{
    aux_entry *ent;

    if( AuxLookup( to ) != NULL )
        return;
    ent = AuxLookup( from );
    if( ent == NULL )
        return;
    CreateAux( to );
    CurrEntry->info = ent->info;
    ent->info->use++;
    CurrEntry->next = AuxList;
    AuxList = CurrEntry;
}
Ejemplo n.º 3
0
static bool setAuxInfo(         // SET CURRENT INFO. STRUCTURE
    unsigned m_type,            // - type to be set
    bool create_new )           // - true if we want a new aux_info
{
    bool found;

    found = true;
    CurrInfo = magicWords[m_type].info;
    if( CurrInfo == NULL ) {
        if( create_new ) {
            CreateAux( Buffer );
        } else {
            found = false;
        }
    }
    return( found );
}
Ejemplo n.º 4
0
static boolean GetAliasInfo(
    void )
{
    char buff[256];
    boolean isfar16;
    boolean retn;

    CurrAlias = &DefaultInfo;
    if( CurToken != T_LEFT_PAREN ) {
        retn = TRUE;
    } else {
        NextToken();
        if( ! PragIdCurToken() ) {
            retn = FALSE;
        } else {
            PragCurrAlias();
            strcpy( buff, Buffer );
            NextToken();
            if( CurToken == T_RIGHT_PAREN ) {
                NextToken();
                retn = TRUE;
            } else if( CurToken == T_COMMA ) {
                NextToken();
                if( ! PragIdCurToken() ) {
                    retn = FALSE;
                } else {
                    isfar16 = PragRecog( "far16" );
                    CreateAux( buff );
                    PragCurrAlias();
                    NextToken();
                    if( CurToken == T_RIGHT_PAREN ) {
                        AuxCopy( CurrInfo, CurrAlias );
                        NextToken();
                    }
                    if( isfar16 ) {
                        CurrInfo->flags |= AUX_FLAG_FAR16;
                    }
                    PragEnding( TRUE );
                    retn = FALSE;
                }
            }
        }
    }
    return retn;
}
Ejemplo n.º 5
0
void AsmSysMakeInlineAsmFunc( bool too_many_bytes )
/*************************************************/
{
    int                 code_length;
    SYM_HANDLE          sym_handle;
    TREEPTR             tree;
    bool                uses_auto;
    char                name[8];

    /* unused parameters */ (void)too_many_bytes;

    code_length = AsmCodeAddress;
    if( code_length != 0 ) {
        sprintf( name, "F.%d", AsmFuncNum );
        ++AsmFuncNum;
        CreateAux( name );
        CurrInfo = (aux_info *)CMemAlloc( sizeof( aux_info ) );
        *CurrInfo = WatcallInfo;
        CurrInfo->use = 1;
        CurrInfo->save = AsmRegsSaved;  // indicate no registers saved
        uses_auto = InsertFixups( AsmCodeBuffer, code_length, &CurrInfo->code );
        if( uses_auto ) {
            /*
               We want to force the calling routine to set up a [E]BP frame
               for the use of this pragma. This is done by saying the pragma
               modifies the [E]SP register. A kludge, but it works.
            */
            HW_CTurnOff( CurrInfo->save, HW_SP );
        }
        CurrEntry->info = CurrInfo;
        CurrEntry->next = AuxList;
        AuxList = CurrEntry;
        CurrEntry = NULL;
        sym_handle = MakeFunction( name, FuncNode( GetType( TYPE_VOID ), FLAG_NONE, NULL ) );
        tree = LeafNode( OPR_FUNCNAME );
        tree->op.u2.sym_handle = sym_handle;
        tree = ExprNode( tree, OPR_CALL, NULL );
        tree->u.expr_type = GetType( TYPE_VOID );
        AddStmt( tree );
    }
}
Ejemplo n.º 6
0
void SetCurrInfo( char *name )
/****************************/
{
    SYM_HANDLE      sym_handle;
    SYM_ENTRY       sym;
    type_modifiers  sym_attrib = FLAG_NONE;

    CurrInfo = MagicKeyword( name );
    if( CurrInfo == NULL ) {
        if( CurrAlias == NULL ) {
            sym_handle = SymLook( HashValue, name );
            if( sym_handle != 0 ) {
                SymGet( &sym, sym_handle );
                sym_attrib = sym.mods;
            }
            CurrAlias = GetLangInfo( sym_attrib );
        }
        CreateAux( name );
    } else if( CurrAlias == NULL ) {
        CurrAlias = CurrInfo;
    }
}
Ejemplo n.º 7
0
static bool GetAliasInfo(
    void )
{
    char buff[256];
    bool isfar16;

    CurrAlias = &DefaultInfo;
    if( CurToken != T_LEFT_PAREN )              // #pragma aux symbol ....
        return( IS_ID_OR_KEYWORD( CurToken ) );
    NextToken();
    if( !IS_ID_OR_KEYWORD( CurToken ) )         // error
        return( FALSE );
    PragCurrAlias();
    strcpy( buff, Buffer );
    NextToken();
    if( CurToken == T_RIGHT_PAREN ) {           // #pragma aux (alias) symbol ....
        NextToken();
        return( IS_ID_OR_KEYWORD( CurToken ) );
    }
    if( CurToken == T_COMMA ) {                 // #pragma aux (alias, symbol)
        NextToken();
        if( IS_ID_OR_KEYWORD( CurToken ) ) {
            isfar16 = PragRecog( "far16" );
            CreateAux( buff );
            PragCurrAlias();
            NextToken();
            if( CurToken == T_RIGHT_PAREN ) {
                AuxCopy( CurrInfo, CurrAlias );
                NextToken();
            }
            if( isfar16 ) {
                CurrInfo->flags |= AUX_FLAG_FAR16;
            }
            PragEnding( TRUE );
        }
    }
    return( FALSE );
}