示例#1
0
static void Compile( void )
{
    InitGlobalSegs();
    ProgSw |= PS_DONT_GENERATE;
    InitAuxInfo();      // must be done before ComRead()
    InvokeCompile();
    if( ( (Options & OPT_SYNTAX) == 0 ) &&  // syntax check only
        ( ( CurrFile != NULL ) ) &&         // not an "null" file
        ( (ProgSw & PS_ERROR) == 0 ) ) {    // no error during first pass
        CurrFile->flags &= ~CONC_PENDING;
        CurrFile->rec = 0;
        SrcRecNum = 0;
        ProgSw = 0;
        SDRewind( CurrFile->fileptr );
        InvokeCompile();
    }
    FiniAuxInfo();
    FreeGlobalSegs();
}
示例#2
0
void PragAux( void )
/******************/
{
    struct {
        unsigned    f_call   : 1;
        unsigned    f_loadds : 1;
        unsigned    f_rdosdev: 1;
        unsigned    f_export : 1;
        unsigned    f_parm   : 1;
        unsigned    f_value  : 1;
        unsigned    f_modify : 1;
        unsigned    f_frame  : 1;
        unsigned    uses_auto: 1;
    } have;

    InitAuxInfo();
    if( !GetAliasInfo() )
        return;
    if( CurToken != T_ID )
        return;
    SetCurrInfo( Buffer );
    NextToken();
    PragObjNameInfo( &AuxInfo.objname );
    have.f_call   = 0;
    have.f_loadds = 0;
    have.f_rdosdev = 0;
    have.f_export = 0;
    have.f_parm   = 0;
    have.f_value  = 0;
    have.f_modify = 0;
    have.f_frame = 0;
    have.uses_auto = 0; /* BBB - Jan 26, 1994 */
    for( ;; ) {
        if( !have.f_call && CurToken == T_EQUAL ) {
            have.uses_auto = GetByteSeq( &AuxInfo.code );
            have.f_call = 1;
        } else if( !have.f_call && PragRecog( "far" ) ) {
            AuxInfo.cclass |= FAR;
            have.f_call = 1;
        } else if( !have.f_call && PragRecog( "near" ) ) {
            AuxInfo.cclass &= ~FAR;
            AuxInfoFlg.f_near = 1;
            have.f_call = 1;
        } else if( !have.f_loadds && PragRecog( "loadds" ) ) {
            AuxInfo.cclass |= LOAD_DS_ON_ENTRY;
            have.f_loadds = 1;
        } else if( !have.f_rdosdev && PragRecog( "rdosdev" ) ) {
            AuxInfo.cclass |= LOAD_RDOSDEV_ON_ENTRY;
            have.f_rdosdev = 1;
        } else if( !have.f_export && PragRecog( "export" ) ) {
            AuxInfo.cclass |= DLL_EXPORT;
            have.f_export = 1;
        } else if( !have.f_parm && PragRecog( "parm" ) ) {
            GetParmInfo();
            have.f_parm = 1;
        } else if( !have.f_value && PragRecog( "value" ) ) {
            GetRetInfo();
            have.f_value = 1;
        } else if( !have.f_value && PragRecog( "aborts" ) ) {
            AuxInfo.cclass |= SUICIDAL;
            have.f_value = 1;
        } else if( !have.f_modify && PragRecog( "modify" ) ) {
            GetSaveInfo();
            have.f_modify = 1;
        } else if( !have.f_frame && PragRecog( "frame" ) ) {
            AuxInfo.cclass |= GENERATE_STACK_FRAME;
            have.f_frame = 1;
        } else {
            break;
        }
    }
    if( have.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_CTurnOn( AuxInfo.save, HW_SP );
    }
    CopyAuxInfo();
    PragEnding();
}